when I NEED to build the game i cant build it because of editor code. But when i put Editor code in #if #endif and still i cant build it
And i try in a new project but still my visual studio not reacting to define symbols
How to fix that ???
Void Start ()
{
#if UNITY_EDITOR
//SOME CODE
#end if
}
This is not working
Not sure what you mean, but if you have build errors, it would be nice to see an image or code-block of the errors
1 Like
It’s worth noting that if you have any namespace defines (eg: using UnityEditor;
), those need to be wrapped in preprocessor directives as well.
@Mike0102 make sure that you use code tags properly so that it’s easier to read your code. You can check this documentation page on conditional compilation, but looking at your code the issue this line:
#end if
and you could try to remove the whitespace between ‘end’ and ‘if’:
#endif