I want to make a sub-versions with different language in my project.
The current solution is to use #define & #if to decide witch resource version to load.
But it seems like #define does not work global in Unity, I have to define every script.
In c++ I can put the define into a h file, and every script includes it.
When changing I only have to edit the h file,
but now I have to edit every script in Unity.
Is there any way to make Unity include a common header,
or use a global define?
What you described can be achieved by adding a file called smcs.rsp to the /Assets/ folder. Anything within this file will be added to the compiler as arguments.
So for instance, adding ‘-define:VER_1’ to smcs.rsp, will add VER_1 as a global define for all C# scripts, and will save you having to add it to each file.
I’ve found this to be a pretty handy, and hardly documented little feature, hopefully you find it as useful as I have.
Hey Guys, I’ve put togeather a little example project to better illustrate this, if my post didn’t clarify things, it will. You can grab it here: [1615-defineexample.zip|1615]