- Home /
Can I use preprocessor directives (e.g. UNITY_5) in a managed plugin?
I'm building a managed unity plugin and want to use platform defines such as UNITY_5. Is it possible? Is yes, how?
Answer by FortisVenaliter · May 06, 2016 at 09:08 PM
Yes, but you need to manage them yourself. In Visual Studio, you can define preprocessor directives (called "Conditional compilation symbols") in the Project Settings window, under the Build Tab.
But, like I said, you have to manage them manually. They won't pick up changes from the unity environment if they're built outside that environment.
I was specifically asking about the Unity defined preprocessor directives.
Nope, because those aren't defined until you build your game, and the libraries are built prior to that. To do that, you'd have to export them separately with the different permutations, and have Unity dynamically link the correct one. But I'm not sure how you'd go about the latter.