Platform Defines

The platform defines that Unity supports for your scripts are:

   
Property: Function:
UNITY_EDITOR #define directive for calling Unity Editor scripts from your game code.
UNITY_EDITOR_WIN #define directive for Editor code on Windows.
UNITY_EDITOR_OSX #define directive for Editor code on Mac OSX.
UNITY_STANDALONE_OSX #define directive for compiling/executing code specifically for OS X (including Universal, PPC and Intel architectures).
UNITY_STANDALONE_WIN #define directive for compiling/executing code specifically for Windows standalone applications.
UNITY_STANDALONE_LINUX #define directive for compiling/executing code specifically for Linux standalone applications.
UNITY_STANDALONE #define directive for compiling/executing code for any standalone platform (OS X, Windows or Linux).
UNITY_WII #define directive for compiling/executing code for the Wii console.
UNITY_IOS #define directive for compiling/executing code for the iOS platform.
UNITY_IPHONE Deprecated. Use UNITY_IOS instead.
UNITY_ANDROID #define directive for the Android platform.
UNITY_PS3 #define directive for running PlayStation 3 code.
UNITY_PS4 #define directive for running PlayStation 4 code.
UNITY_SAMSUNGTV #define directive for executing Samsung TV code.
UNITY_XBOX360 #define directive for executing Xbox 360 code.
UNITY_XBOXONE #define directive for executing Xbox One code.
UNITY_TIZEN #define directive for the Tizen platform.
UNITY_TVOS #define directive for the Apple TV platform.
UNITY_WP_8 #define directive for Windows Phone 8.
UNITY_WP_8_1 #define directive for Windows Phone 8.1.
UNITY_WSA #define directive for Windows Store Apps. Additionally, NETFX_CORE is defined when compiling C# files against .NET Core.
UNITY_WSA_8_0 #define directive for Windows Store Apps when targeting SDK 8.0.
UNITY_WSA_8_1 #define directive for Windows Store Apps when targeting SDK 8.1.
UNITY_WSA_10_0 #define directive for Windows Store Apps when targeting Universal Windows 10 Apps. Additionally WINDOWS_UWP and NETFX_CORE are defined when compiling C# files against .NET Core.
UNITY_WINRT Equivalent to UNITY_WP_8 | UNITY_WSA.
UNITY_WINRT_8_0 Equivalent to UNITY_WP_8 | UNITY_WSA_8_0.
UNITY_WINRT_8_1 Equivalent to UNITY_WP_8_1 | UNITY_WSA_8_1. This is also defined when compiling against Universal SDK 8.1.
UNITY_WINRT_10_0 Equivalent to UNITY_WSA_10_0
UNITY_WEBGL #define directive for WebGL.
UNITY_ADS #define directive for calling Unity Ads methods from your game code. Version 5.2 and above.
UNITY_ANALYTICS #define directive for calling Unity Analytics methods from your game code. Version 5.2 and above.
UNITY_ASSERTIONS #define directive for assertions control process.

Also you can compile code selectively depending on the version of the engine you are working on. Currently the supported ones are:

UNITY_2_6 Platform define for the major version of Unity 2.6.
UNITY_2_6_1 Platform define for specific version 1 from the major release 2.6.
UNITY_3_0 Platform define for the major version of Unity 3.0.
UNITY_3_0_0 Platform define for the specific version 0 of Unity 3.0.
UNITY_3_1 Platform define for major version of Unity 3.1.
UNITY_3_2 Platform define for major version of Unity 3.2.
UNITY_3_3 Platform define for major version of Unity 3.3.
UNITY_3_4 Platform define for major version of Unity 3.4.
UNITY_3_5 Platform define for major version of Unity 3.5.
UNITY_4_0 Platform define for major version of Unity 4.0.
UNITY_4_0_1 Platform define for major version of Unity 4.0.1.
UNITY_4_1 Platform define for major version of Unity 4.1.
UNITY_4_2 Platform define for major version of Unity 4.2.

最新Unity3D系统宏地址:http://docs.unity3d.com/Documentation/Manual/PlatformDependentCompilation.html



Unity3D 系统宏的更多相关文章

  1. Objective-C中系统宏的用法总结

    先说一下本文中会提到的内容:##,__VA_ARGS__, __FILE__, __LINE__ , __FUNCTION__等 宏变量: 先举一个例子,会用到上面这些宏: #define mypri ...

  2. Ruby操作VBA的注意事项和技巧(2):宏里调用和控制窗体以及窗体上的控件、不同workbook之间的宏互相调用

    4.宏里调用并控制窗体以及窗体上的各种控件 1 Sub Criterion_Check() 2 If Workbooks.count = 0 Then '如果当前没有打开的工作薄的话需要发出警告 3 ...

  3. [原]Unity3D深入浅出 - 常见三维软件与Unity3D的单位比例

    Unity3d系统默认单位是米 Maya:Unity3D  1M:100M 3DMax:Unity3D 100M:1M Cinema 4D:Unity3D 1M:100M Lightwavew:Uni ...

  4. iOS:PrefixHeader / 头文件 / 宏定义(18-03-02更)

    宏定义,不一定放在PCH文件,可能放在一个.h文件,再用PCH包含进来. 1.屏幕尺寸 // 屏幕尺寸 #define kSCREEN_WIDTH [UIScreen mainScreen].boun ...

  5. C++通过宏定义判断操作系统及编译器

    INTRODUCTION: C++的编译环境千奇百怪,很多时候一些代码在某些编译环境下可用,一旦移到其他环境下,就会干脆Compile Error 对此,我们可以使用C++的宏定义来判断操作系统,从而 ...

  6. linux系统编程之进程(四)

    今天继续研究进程相关的东东,话不多说,进入正题: SIGCHLD: 关于它,之前章节的学习中已经用到了,具体可以参考博文:http://www.cnblogs.com/webor2006/p/3500 ...

  7. 痞子衡嵌入式:IAR内部C-SPY调试组件配套宏文件(.mac)用法介绍

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家分享的是IAR内部C-SPY调试组件配套宏文件(.mac)用法. 痞子衡之前写过一篇 <JLink Script文件基础及其在IAR下调用 ...

  8. C语言之预处理

    这是2016年的最后一篇博客,年初定的计划是写12篇博客,每月一篇,1/3转载,2/3原创,看来是实现不了了! -- 题外话.今天要写的东西是C语言中的预处理器,我们常说的宏定义的用法.为什么要写这个 ...

  9. C/C++预处理指令#define,#ifdef,#ifndef,#endif…

    2016年12月29日更新: 今天查看以前文件的时候, 突然发现了#error 这个预处理指令.然后回想一下工作, 发现这个指令使用场景还是很多的.比如: 一个项目的模块儿之多,源文件之大,代码之多, ...

随机推荐

  1. Haskell 笔记 ②

    ①如何写一个求阶层函数? fac 0 =1 fac n=n*fac(n-1) 函数自适应匹配参数,可以把特判情况写在前面,注意按顺序匹配的,n这种万能情况写在最前面就完蛋了.同时你也注意到,函数只能一 ...

  2. 使用 Sublime Text 做 Javascript 编辑器 - 集成 SublimeCodeIntel 实现代码智能提示及自动完成

    Sublime Text 是一个强大并具有很强扩展性的 IDE,可通过为其安装 SublimeCodeIntel 插件实现代码智能提示和自动完成功能. 目前该插件支持以下语言: JavaScript, ...

  3. 在VS2010中创建并引用dll(C#)

    一般情况下,如果在新建或添加时选择“windows应用程序”或“控制台应用程序”时,‎结果都会被编译成exe,而选择“类库”时就会被编译成dll.也可以在项目属性中更改其输出类型,如下图:       ...

  4. Odoo Many2many 指定默认分组过滤

    在odoo里如果想单击某个菜单打开的页面是自带过滤的,可以在打开菜单的动作中添加默认过滤来实现,今天有同学在群里问,如何在Many2many的添加更多的弹出窗口中添加类似的过滤,其实是非常非常简单的, ...

  5. css限制div字符超出部分,简单有方便

    text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-w ...

  6. HTML静态网页 标签、表格

    HTML静态网页: 打开DREAMWEAVER,新建HTML,如下图: body的属性: bgcolor 页面背景色 background  背景壁纸.图片 text  文字颜色 topmargin ...

  7. phpweb漏洞合集

    admin' or '1'='1 万能密码 inurl:/class/?1.html inurl:webmall/query.php?typeid=?inurl:shop/class/?226.htm ...

  8. Java面试题大全(一)

    JAVA相关基础知识 1.面向对象的特征有哪些方面 1.抽象: 抽象就是忽略一个主题中与当前目标无关的那些方面,以便更充分地注意与当前目标有关的方面.抽象并不打算了解全部问题,而只是选择其中的一部分, ...

  9. eclipse 导入web项目后,线程假死

    eclipse 导入web项目后,就出现关闭后,线程还存在的情况.使用java mission control 查看发现java script indexing线程在running. 关闭js验证后, ...

  10. java AES 加密与解密

    package com.ss.util.secret;   import java.io.UnsupportedEncodingException; import java.security.Inva ...