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. ACM 图像有用区域

    图像有用区域 时间限制:3000 ms  |  内存限制:65535 KB 难度:4   描述 “ACKing”同学以前做一个图像处理的项目时,遇到了一个问题,他需要摘取出图片中某个黑色线圏成的区域以 ...

  2. ACM 汉诺塔(三)

    汉诺塔(三) 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 在印度,有这么一个古老的传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针.印度 ...

  3. [Cocos2d-x For WP8]矩形碰撞检测

    在游戏中我们通常会涉及到两个精灵之间的碰撞的计算,那么在Cocos2d-x里面我们通常会用矩形碰撞检测来计算两个精灵在运动的过程中是否碰撞到了.原理很简单,就是当运动的时候通过精灵的矩形坐标进行遍历来 ...

  4. POJ 1321 简单dfs

    1.POJ 1321  棋盘问题 2.总结: 题意:给定棋盘上放k个棋子,要求同行同列都不重. #include<iostream> #include<cstring> #in ...

  5. Html5_移动前端不得不了解的html5 head 头标签

    移动前端不得不了解的html5 head 头标签   本文主要内容来自一丝的常用的 HTML 头部标签和百度FEX的HTML head 头标签. 移动端的工作已经越来越成为前端工作的重要内容,除了平常 ...

  6. GO语言练习:channel 工程实例

    1.工程代码 2.编译及运行 1.工程目录结构 $ tree cgss cgss ├── cgss.go └── src ├── cg │   ├── centerclient.go │   ├── ...

  7. AngularJS 乱记

    1. 前端简单逻辑 <title data-ng-bind="{true:' ('+notice_count+') '}[notice_count > 0]+{true:glob ...

  8. linux下定时重启tomcat

    工具/原料 linux tomcat 方法/步骤 编写tomcat_shutdown.sh: #!/bin/sh export JAVA_HOME=/home/oracle/jdk1..0_67/ e ...

  9. zabbix3.2.0beta2 监控模版

    Zabbix监控中用到了一系列模版,nginx后端检测状态 微信告警等一系列常规的服务应用监控 memcached监控模版,可以自己重新定义memcached的端口 http://files.cnbl ...

  10. vsphere平台为win系统动态扩展磁盘

    1.关闭win虚拟机 2.在vcenter管理中加大磁盘空间 3.开启win虚拟机(此时磁盘并没有加大) 4.打开cmd命令行: 进入分区管理--->查看磁盘--->选择磁盘---> ...