This script shows all the operant Unity platform specific compiler definitions, e.g. NET_STANDARD_2_0, UNITY_5_0, UNITY_2018_2_0, etc.
I wrote this because I wanted to easily determine the delta between two Unity settings while maintaining Minibuffer Console and Custom Pointer. Writing a t4 script to just go through the numerous possibilities seemed a sane route. (It's the UNITY_X_Y_Z part that'll get ya.)
For a project, the CompilerDefinitions.cs
script produces this output to the debug log.
UNITY_EDITOR defined.
UNITY_EDITOR_OSX defined.
UNITY_STANDALONE_OSX defined.
UNITY_STANDALONE defined.
UNITY_ANALYTICS defined.
UNITY_ASSERTIONS defined.
ENABLE_MONO defined.
NET_4_6 defined.
UNITY_2018 defined.
UNITY_2018_2 defined.
UNITY_2018_2_0 defined.
Add the CompilerDefinitions
component to a game object.
Inherit and override the Defined(string define)
method.
public virtual void Defined(string define) {
Debug.Log(define + " defined.");
}
Edit the CompilerDefinitions.tt
file.
This project is released under the MIT license.