I know about platform-specific defines which are documented here:
But today I realized that Unity actually puts a lot more Defines into the Mono project than just those listed on that page. The list of defines in my current C# project I’m working on in Windows is here (This comes from the Compiler options under my Assembly-CSharp mono project):
DEBUG;
TRACE;
UNITY_ANDROID;
ENABLE_MICROPHONE;
ENABLE_TEXTUREID_MAP;
ENABLE_AUDIO_FMOD;
ENABLE_MONO;
ENABLE_SPRITES;
ENABLE_TERRAIN;
ENABLE_GENERICS;
ENABLE_SUBSTANCE;
INCLUDE_WP8SUPPORT;
ENABLE_WWW;
ENABLE_IMAGEEFFECTS;
ENABLE_WEBCAM;
INCLUDE_METROSUPPORT;
RENDER_SOFTWARE_CURSOR;
ENABLE_NETWORK;
ENABLE_PHYSICS;
ENABLE_CACHING;
ENABLE_CLOTH;
UNITY_ANDROID_API;
ENABLE_2D_PHYSICS;
ENABLE_SHADOWS;
ENABLE_AUDIO;
ENABLE_NAVMESH_CARVING;
ENABLE_SINGLE_INSTANCE_BUILD_SETTING;
UNITY_4_3_2;
UNITY_4_3;
ENABLE_PROFILER;
UNITY_EDITOR;
UNITY_EDITOR_WIN
So, I see the defines I expected to see based on the documentation, but there are many many more as well. Now, most of these defines clearly come from Unity as they correspond to Unity features (e.g. - terrain, 2D physics, etc.), but I can find no documentation on them anywhere. It makes me wonder what they would be used for and if there is any way to control them. For example, is there some hidden option to disable terrain if your game doesn’t use that system, possibly reducing build size?
I also noticed that when I tick the “Development Build” checkbox on my Build Settings in the Unity Editor it updates the C# Mono project to also include the DEVELOPMENT_BUILD define. So, it appears that Unity will modify these defines based on settings specified in the Unity Editor.
Does anyone have any insight into any of these extra defines?