Unity3d 平台宏定义
来源:互联网 发布:双翼软件官网 编辑:程序博客网 时间:2024/05/29 04:31
1.依赖于平台的编译
Unity包含一个“平台相关的编译”功能。这包括一些预处理指令,让你分割你的脚本编译和专为支持的平台之一执行代码段。
您可以Unity编辑器中运行代码,这样你就可以专门为你的目标平台编译代码,并在编辑器中测试!
2.Platform #define directives
The platform #define directives that Unity supports for your scripts are as follows:
From Unity 2.6.0 onwards, you can compile code selectively. The options available depend on the version of the Editor that you are working on. Given a version number X.Y.Z (for example, 2.6.0), Unity exposes three global #define directives in the following formats: UNITY_X, UNITY_X_Y and UNITY_X_Y_Z.
Here is an example of #define directives exposed in Unity 5.0.1:
UNITY_5 | #define directive for the release version of Unity 5, exposed in every 5.X.Y release.
UNITY_5_0 | #define directive for the major version of Unity 5.0, exposed in every 5.0.Z release.
UNITY_5_0_1 | #define directive for the minor version of Unity 5.0.1.
You can compile code selectively based on the earliest version of Unity required to compile or execute a given portion of code. Given the same version format as above (X.Y.Z), Unity exposes one global #define directive that can be used for this purpose, in the format UNITY_X_Y_OR_NEWER.
The supported #define directives are:
UNITY_5_3_OR_NEWER Global #define directive exposed starting from Unity 5.3.
You can also compile code selectively depending on the scripting back-end.
ENABLE_MONO Scripting back-end #define directive for Mono.
ENABLE_IL2CPP Scripting back-end #define directive for IL2CPP.
ENABLE_DOTNET Scripting back-end #define directive for .NET.
You can also use the DEVELOPMENT_BUILD #define directive to identify whether your script is running in a player which was built with the “Development Build” option enabled.
参考资料:unity官方文档
- Unity3d 平台宏定义
- Unity3D -- 平台宏定义
- Unity3D 多平台_预编译相关宏定义
- Unity3D 多平台_预编译相关宏定义
- Unity3d 多平台_预编译相关宏定义
- Unity3D 多平台_预编译相关宏定义
- 【Unity3D自学记录】Unity3D宏定义
- 跨平台宏定义
- Unity平台宏定义
- #ifdef 跨平台宏定义
- unity中宏定义平台
- unity多平台宏定义
- Unity3D 预编译相关宏定义
- 平台定义
- Unity3D中 TRANSFORM_TEX 定义
- 跨平台开发,各种宏的定义
- 跨平台开发,各种宏的定义
- c++各个平台的宏定义
- Broadcast middleware common flow
- 防止SQL注入解决办法
- Toast实现图文混排
- Palindrome Number leetcode
- 使用InteliJ IDEA导出jar包执行报错:找不到主清单属性
- Unity3d 平台宏定义
- 白话经典算法系列(一共16篇文章)
- 股票指标算法
- 洛谷1158-导弹拦截
- poj1458 最长公共子序列(lcs)
- eclipse与mysql链接(Java后台)
- CoordinatorLayout协调布局
- expect spawn、linux expect 用法
- js函数前加分号和感叹号是什么意思?有什么用?