Unity各平台内置宏定义
| 属性 | 方法 |
|---|---|
| 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 OS X. |
| UNITY_STANDALONE | #define directive for compiling/executing code for any standalone platform (Mac OS X, Windows or Linux). |
| UNITY_STANDALONE_WIN | #define directive for compiling/executing code specifically for Windows standalone applications. |
| UNITY_STANDALONE_OSX | #define directive for compiling/executing code specifically for Mac OS X (including Universal, PPC and Intel architectures). |
| UNITY_STANDALONE_LINUX | #define directive for compiling/executing code specifically for Linux standalone applications. |
| UNITY_ANDROID | #define directive for the Android platform. |
| UNITY_IOS | #define directive for compiling/executing code for the iOS platform. |
| UNITY_IPHONE | Deprecated. Use UNITY_IOS instead. |
| UNITY_WEBGL | #define directive for WebGL. |
| UNITY_WP_8_1 | #define directive for Windows Phone 8.1. |
| UNITY_PS4 | #define directive for running PlayStation 4 code. |
| UNITY_XBOXONE | #define directive for executing Xbox One code. |
| UNITY_WII | #define directive for compiling/executing code for the Wii console. |
| UNITY_SAMSUNGTV | #define directive for executing Samsung TV code. |
样例:
// C#
using UnityEngine;
using System.Collections; public class PlatformDefines : MonoBehaviour { void Start () {
#if UNITY_EDITOR
Debug.Log("Unity Editor");
#elif UNITY_IOS
Debug.Log("Unity iPhone");
#else
Debug.Log("Any other platform");
#endif
} }
// JS
function Awake() {
#if UNITY_EDITOR
Debug.Log("Unity Editor");
#endif #if UNITY_IPHONE
Debug.Log("Iphone");
#endif #if UNITY_STANDALONE_OSX
Debug.Log("Stand Alone OSX");
#endif #if UNITY_STANDALONE_WIN
Debug.Log("Stand Alone Windows");
#endif
}
Unity各平台内置宏定义的更多相关文章
- 获取gcc和clang的内置宏定义
下面是对Gcc的内置宏定义的解释: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html https://github.co ...
- C++ 内置宏定义 与 预编译指令
内置宏和预编译指令, 在代码调试.单元测试.跨平台代码中经常会用到.这里记录一下. 1. 内置宏 (文件名,当前行号,当前日期,当前时间,当前执行方法名) __FILE____LINE____DATE ...
- 查看GCC的内置宏定义
开发过程中我们常常需要使用宏定义.. 为了尽可能多的使用GCC为我们提供的特性,首先我们需要知道gcc提供了那些特性... gcc -dM -E - < /dev/null 没错,就这么一句话就 ...
- unity 着色器内置宏
目标平台 Macro: Target platform: SHADER_API_D3D11 Direct3D 11 SHADER_API_GLCORE Desktop OpenGL “core” (G ...
- 编译器内置宏__LINE__&__FUNCTION__
编译器内置宏: 先介绍几个编译器内置的宏定义,这些宏定义不仅可以帮助我们完成跨平台的源码编写,灵活使用也可以巧妙地帮我们输出非常有用的调试信息. ANSI C标准中有几个标准预定义宏(也是常用的): ...
- c语言编译器内置宏
注:转自http://www.cnblogs.com/lixiaohui-ambition/archive/2012/08/21/2649052.html 感谢分享 前言: 我们在写程序的时候,总是 ...
- 一起talk C栗子吧(第一百二十四回:C语言实例--内置宏)
各位看官们,大家好,上一回中咱们说的是显示变量和函数地址的样例,这一回咱们说的样例是:内置宏.闲话休提,言归正转.让我们一起talk C栗子吧! 看官们,我们在编译程序的时候,假设有语法错误,编译器就 ...
- python函数基础:调用内置函数&定义函数
调用内置函数 有很多内置函数,在使用中需要积累.这里只举两个例子: 分别调用abs和数据类型转换,注意当入参类型错误时候会报错 ''' print('abs(-100)') abs(-100) pri ...
- c/c++一些常用的内置宏
关于 本文演示环境: win10 + VS2017 Note 市面上的编译器五花八门,但是通常都支持: __DATE__,__FILE__,__LINE__ 和 __TIME__ 这个4个宏 VS20 ...
随机推荐
- 【JavaScript】闭包应用之数据缓存
最近的开发中的许多事件会被频繁的触发,由于没有做缓存的处理,每次事件触发都会后台调用一样的数据.这几天我突然意识到自己的代码有很大的优化空间,继而想起了闭包可以有缓存的功能,于是乎便对其进行了深入的研 ...
- 《APP移动终端决胜之道视觉设计艺术》学习笔记
1.20-2.9 1.合理的层级化2.信息的整合(短信收发件箱),信息的整合就像创建文件夹,可以将相关的东西放在一起,以便于使用者搜索与查找3.(微信聊天界面)相比之下使用了对话框图形的界面,元素更加 ...
- fiddler抓包出现Tunnel to
在抓包的时候,有时候会遇到很多的tunnel to,图标是一把锁的形状,如下图: connect是为了建立http tunnel,connect是http众多方法中的其中一种,它跟post.get.p ...
- DAO层,Service层,Controller层、View层介绍
来自:http://jonsion.javaeye.com/blog/592335 DAO层 DAO 层主要是做数据持久层的工作,负责与数据库进行联络的一些任务都封装在此,DAO层的设计首先是设计DA ...
- spider-抓取网页内容
使用urllib2抓取网页内容: import urllib2 from HTMLParser import HTMLParser request = urllib2.Request('http:// ...
- F5 IIS Log获取客户端源IP
1.配置F5启用X-Forwarded-For方法: 1:Local Traffic-Profiles-Http-改"Insert XForwarded For"为Enable 2 ...
- 一点二次插值、二点二次插值 ,matlab
syms f x a b c; f(x)=3*x^4-4*x^3-12*x^2; q(x)=a*x^2+b*x+c; %二点二次插值 x=[-1.2 -0.8]; ff=diff(diff(f)); ...
- August 05th 2017 Week 31st Saturday
All endings are beginnings, we just don't know it at the time. 所有的结局都是新的开始,只是当时我们不知道而已. Several mont ...
- 【Win10+eclipse+MinGW+QT安装教程】已有eclipse环境下配置QT插件出错详解
(纪念一下装了一整天濒临绝望的自己[/doge]) (以下所有下载项一律使用32位) step1:下载安装eclipse.适配的jdk.MinGW和QT 1.下载32位eclipse for c++以 ...
- Apache Spark : RDD
Resilient Distributed Datasets Resilient Distributed Datasets (RDD) is a fundamental data structure ...