Unity3D 系统宏

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

时间: 2024-08-04 19:36:47

Unity3D 系统宏的相关文章

Unity3D -- 平台宏定义

官方文档网址:https://docs.unity3d.com/Manual/PlatformDependentCompilation.html Property: Function:UNITY_EDITOR Unity编辑器UNITY_EDITOR_WIN Windows 操作系统.UNITY_EDITOR_OSX macos操作系统UNITY_STANDALONE_OSX 专门为macos(包括Universal, PPC,Intel architectures)平台的定义UNITY_STA

sas宏(1)、系统宏变量、自定义宏变量、输出宏值、大量实用宏函数、宏与text结合

SAS macro variables enable you to substitute text in your SAS programs(替代作用,和c++的 #define 差不多) When you reference a macro variable in a SAS program, SAS replaces the reference with the text value that has been assigned to that macro variable. By subs

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

先说一下本文中会提到的内容:##,__VA_ARGS__, __FILE__, __LINE__ , __FUNCTION__等 宏变量: 先举一个例子,会用到上面这些宏: #define myprintf(...) printk("[lch]:File:%s, Line:%d, Function:%s," \ __VA_ARGS__, __FILE__, __LINE__ ,__FUNCTION__); 此处的 #define 的作用是将 myprintf( )换成后面那一大串的内容

64位操作系统宏不能使用解决方案

找到以下配置文件 "C:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\vsmsvr10.exe.config" "C:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\vsaenv10.exe.config" "C:\Program Files (x86)\Microsoft Visual

系统文件夹路径的系统宏定义

Const CSIDL_ADMINTOOLS As Long = &H30                '(用户)\开始菜单\程序\系统管理工具Const CSIDL_ALTSTARTUP As Long = &H1D                '未本地化的启动Const CSIDL_APPDATA As Long = &H1A                   '(用户)\应用程序的数据Const CSIDL_BITBUCKET As Long = &HA    

认识STM32的系统时钟

STM32共有五个时钟源,分别是: HSI是高速内部时钟.RC振荡器,频率为8MHz: HSE是高速外部时钟,频率范围为4~6MHz; (可接石英/陶瓷谐振器或者接外部时钟源) LSI是低速内部时钟,频率40kHz; (独立看门狗时钟源.可作RTC时钟源) LSE是低速外部时钟,频率为32.768kHz石英晶体; (主要RTC时钟源) PLL是锁相环倍频输出,频率可选择为HSI/2.HSE或者HSE/2.倍频可选择2~16倍,但其输出频率最大不超过72MHz: 此处重点介绍系统时钟,一般其他所有

C语言之预处理

1 #define name value 我再学习预处理直接的驱动力是看了php的源码,开头一大推的宏定义器,之前'掌握'的一点#define的用法太少了,根本看不懂源码中宏的处理逻辑和运行的路径.所以再学习预处理器很有必要,里面好多东西其实并不难,只是你没有接触到,等你学习了,就感觉容易了. 一.宏定义和使用中的坑 这小节采用先给代码再说明的形式,这样你可以看看每个代码的运行结果是否和你预期的一致! 宏是什么,宏就是#define机制把指定的参数替换的文本中,这样的实现方式就是宏.使用宏定义可

一周随笔--15.9.21

一周新知识点记录(15.9.21) 一. writeToFile:atomically: - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile; 第二个参数的意思是: 如果为YES则保证文件的写入原子性,就是说会先创建一个临时文件,直到文件内容写入成功再导入到目标文件里. 如果为NO,则直接写入目标文件里. 二.  NSerror 参数依次为: 1.错误域(NSString) 2.错误标识 (NSIntege

C语言的通用链表

在操作系统编程中, 往往是使用C语言, 但C使用起来极为痛苦, 不像C++有方便的STL模板库使用. linux内核中,有一套非常神奇的通用链表结构,能够方便的使用,管理各种类型的数据,我们今天就来研究一下,内核中的C数据结构. 本文参考:[深入分析 Linux 内核链表] 首先,我们的目标是构建一个循环双链表结构,为何是双链表,还要循环,当然是从易用性考虑了,双链表能够方便的得知自己的上一个元素,在内核中管理数据更为方便. 其一般结构大概是这样: 实现机制 首先定义一个list_node结构,