Unity3d Multi-platform _ precompiled related macro definition

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.