Using Conditional Compilers?

Hello, I’m wondering if i can cause conditional compilers to NOT comment out code when I am just testing inside of unity. And ONLY comment out code when I’m building to say iPhone or standalone or android etc.

Docs: Unity - Manual: Conditional Compilation

Thanks
Daniel

I’m not sure to understand your question.

If what you want is just not having MonoDevelop “comment out” your code, then you should have a look at MonoDevelop’s documentation. There are probably some settings for that in syntax highlighting options.

If you want Unity to run any platform specific code if you are in editor, then you’d have to do something like this :

#if UNITY_IPHONE || UNITY_EDITOR
//your code
#endif

Hope it helps :slight_smile: