Reputation: 16338
How can I run the current game inside the Unity editor in debug mode - as in preprocessor variable DEBUG will be true/enabled for scripts. I normally have a lot of:
#if DEBUG
dostuffonlyindebuglikegetalotofmoneyingame();
#else
// release mode
#endif
scattered around my projects. Using Unity 4.6 RC3.
Upvotes: 1
Views: 1743
Reputation: 4661
You can have global #defines with one of these methods:
build settings, per platform
also available via build script: PlayerSettings.SetScriptingDefineSymbolsForGroup
For debug, maybe a check for UNITY_EDITOR
is enough?
Upvotes: 1
Reputation: 16338
I found this:
http://docs.unity3d.com/460/Documentation/ScriptReference/Debug-isDebugBuild.html
Not sure yet but it seems not very good because:
Not sure if Debug.isDebugBuild is removed on release builds or not... if not, Unity sucks :-)
That said, this might be the only option... poor us.
Upvotes: 0