Unity - Manual: Conditional Compilation

Unity - Manual: Custom scripting symbols

DEBUG seems to behave like "UNITY_EDITOR | DEVELOPMENT_BUILD", i.e.:

void Start(){

#if UNITY_EDITOR

Debug.Log("This code is executed in the editor only.");

#endif

#if DEVELOPMENT_BUILD

Debug.Log("This code is executed in development builds only.");

#endif

#if DEBUG

Debug.Log("This code is executed in the editor as well as in development builds.");

#endif

}

[SOLVED] Is unity DEBUG preprocessor always defined? Yes, by design.

Unity: Avoid Custom "ENABLE_X" Preprocessor Symbols - BrutalHack