API Address: http://docs.unity3d.com/Documentation/Manual/PlatformDependentCompilation.html
Platform definition
Called by the Unity_editor editor.
UNITY_STANDALONE_OSX is specifically defined for Mac OS (including UNIVERSAL,PPC and intelarchitectures) platforms.
Unity_dashboard_widget Mac OS DASHBOARD widget (Mac OS Dashboard widget).
Unity_standalone_win Windows operating system.
Unity_standalone_linux is a standalone application for LINUX.
Unity_standalone stand-alone platform (Mac,windows or Linux).
Unity_webplayer Web player (including Windows and Mac Web Player executables).
Unity_wii WII Console platform.
Unity_iphone IPHONE platform.
Unity_android ANDROID platform.
UNITY_PS3 PlayStation 3.
Unity_xbox360 Xbox 360.
Unity_nacl Google Native Client (use this must additionally use Unity_webplayer).
Unity_flash Adobe FLASH.
You can also judge the Unity version, the currently supported version
The Unity_2_6 platform is defined as the major version of Unity 2.6.
The Unity_2_6_1 platform defines major version 1 of the specific version 2.6.
The UNITY_3_0 platform is defined as the major version of Unity 3.0.
The Unity_3_0_0 platform defines a specific version of Unity 3.0 0.
The Unity_3_1 platform is defined as the major version of Unity 3.1.
The Unity_3_2 platform is defined as the major version of Unity 3.2.
The Unity_3_3 platform is defined as the major version of Unity 3.3.
The Unity_3_4 platform is defined as the major version of Unity 3.4.
The Unity_3_5 platform is defined as the major version of Unity 3.5.
The UNITY_4_0 platform is defined as the major version of Unity 4.0.
Unity_4_0_1 Major Version 4.0.1 unified platform definition.
The Unity_4_1 platform is defined as the major version of Unity 4.1.
the Unity_4_2 platform is defined as the major version of UNITY 4.2. Operating Platform
//Get the current operating platform Debug.Log ("plat =" + application.platform);
// Types of platforms that can be obtained public enum runtimeplatform {osxeditor = 0, Osxplayer = 1, Windowspla Yer = 2, Osxwebplayer = 3, Osxdashboardplayer = 4, Windowswebplayer = 5, Wiiplayer = 6 , Windowseditor = 7, Iphoneplayer = 8, PS3 = 9, XBOX360 = ten, Android = 11, NaCl = Linuxplayer = +, Flashplayer = $,}
Example
//JSfunction Awake () {#ifUnity_editor Debug.Log ("Unity Editor");#endif #ifUnity_iphone Debug.Log ("Iphone");#endif #ifUnity_standalone_osx Debug.Log ("Stand Alone OSX");#endif #ifUnity_standalone_win Debug.Log ("Stand Alone Windows");#endif}//C #usingUnityengine;usingSystem.Collections; Public classPlatformdefines:monobehaviour {voidStart () {#ifUnity_editor Debug.Log ("Unity Editor");#endif #ifUnity_iphone Debug.Log ("Iphone");#endif #ifUnity_standalone_osx Debug.Log ("Stand Alone OSX");#endif #ifUnity_standalone_win Debug.Log ("Stand Alone Windows");#endif} }//BooImport UnityengineclassPlatformdefines (monobehaviour): Def Start (): Ifdef UNITY_EDITOR:Debug.Log ("Unity Editor") ifdef UNITY_IPHONE:Debug.Log ("IPhone") ifdef UNITY_STANDALONE_OSX:Debug.Log ("Stand Alone OSX") Ifdef not UNITY_IPHONE:Debug.Log ("Not an IPhone")
Unity3d Multi-platform _ precompiled related macro definition