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各平台宏定义的更多相关文章
- Unity 代码改宏定义
两个函数 PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup); //所有宏定义 ; 分割 PlayerSettings.SetS ...
- Unity 平台宏定义
官方文档: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
- cocos2d-x C++ 判断当前平台宏定义大全
/**************************************************************************** Copyright (c) 2010-201 ...
- Unity各平台内置宏定义
属性 方法 UNITY_EDITOR #define directive for calling Unity Editor scripts from your game code. UNITY_EDI ...
- Unity3D 多平台 预编译 宏定义
平台定义 UNITY_EDITOR 编辑器调用. UNITY_STANDALONE_OSX 专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义. UN ...
- Unity3D 多平台_预编译相关宏定义
http://www.cnblogs.com/zhaoqingqing/p/3510332.html API地址:http://docs.unity3d.com/Documentation/Manua ...
- Linux Kernel代码艺术——系统调用宏定义
我们习惯在SI(Source Insight)中阅读Linux内核,SI会建立符号表数据库,能非常方便地跳转到变量.宏.函数等的定义处.但在处理系统调用的函数时,却会遇到一些麻烦:我们知道系统调用函数 ...
- VC中预处理指令与宏定义详解
刚接触到MFC编程的人往往会被MFC 向导生成的各种宏定义和预处理指令所吓倒,但是预处理和宏定义又是C语言的一个强大工具.使用它们可以进行简单的源代码控制,版本控制,预警或者完成一些特殊的功能. 一个 ...
- C中的预编译宏定义
可以用宏判断是否为ARC环境 #if _has_feature(objc_arc) #else //MRC #endif C中的预编译宏定义 -- 作者: infobillows 来源:网络 在将一 ...
随机推荐
- Orleans 3.0 为我们带来了什么
原文:https://devblogs.microsoft.com/dotnet/orleans-3-0/ 作者:Reuben Bond,Orleans首席软件开发工程师 翻译:艾心 这是一篇来自Or ...
- ArcGIS 用QueryTask查询上限1000的问题
1.打开ArcGIS Server找到自己发布的服务,右键Service Properties,左侧点击Parameters,右侧有一个Maximum number of records return ...
- Python3 之 with语句(高效、便捷)
在实际的编码过程中,有时有一些任务,需要事先做一些设置,事后做一些清理,这时就需要python3 with出场了,with能够对这样的需求进行一个比较优雅的处理,最常用的例子就是对访问文件的处理. 文 ...
- 关于Java运行机制
目录 编译型语言与解释型语言的区别 编译型语言 解释型语言 细数两者之差别 Java的奇怪之处 Java的编译 Java的解释 具体机制 Java既是编译型语言,也是解释型语言. 首先先查找关于两种语 ...
- 解密面试中的套路,你都get到了么?
如果大家有关注一些测试类的公众号或者论坛的话,肯定会发现很多文章都在表示现在行业的寒冬冷潮来了!然后有很多测试行业从业者,或者转行测试行业者都表示:工作好难找,公司跑了千千万,依然拿不到一个offer ...
- python遍历所有盘符下的图片并拷贝下来
最近在学习python,闲着无聊就试着写啦这个小的脚本,虽然有很多不足,但是还是收获不少. 该脚本的功能: ①遍历本地计算机中的所有盘符,并将名称记录下来: ②循环遍历盘符下的所有图片(当然这里可以根 ...
- JSONPath小试牛刀之Snack3
最近在网上看了些JSONPath的入门例子.打算用Snack3这个框架写写例子.json path对`JSON的处理绝对是神器. 1.准备JSON字符串 { "store": { ...
- 如何使用Selenium来计算自动化测试的投资回报率?
跨浏览器测试是一种测试,需要大量的精力和时间.通过不同的浏览器,操作系统,设备,屏幕分辨率测试Web应用程序,以评估针对各种受众的Web内容呈现的过程是一项活动.特别是如果手动处理.使用Seleniu ...
- 小白都会用的免配置 Aria2 图形界面版免费开源下载软件PDM
如今的迅雷真的越发让人失望,好好的下载软件变成了广告浏览器,最近又关停了“远程下载”功能,就算花钱加入会员,很多资源现在也不允许下载了,鸡肋的很. 然而除了 IDM.Folx.qBitorrent 等 ...
- 第三章 学习Shader所需的数学基础(3)
@[TOC] 1. 顶点的坐标空间变换过程 我们知道,在渲染流水线中,一个顶点要经过多个坐标空间的变换才能最终被画在屏幕上.一个顶点最开始是在模型空间中定义的,它最后会被变换到屏幕空间中,得到真正的屏 ...