属性 方法
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各平台宏定义的更多相关文章

  1. Unity 代码改宏定义

    两个函数 PlayerSettings.GetScriptingDefineSymbolsForGroup(targetGroup); //所有宏定义 ; 分割 PlayerSettings.SetS ...

  2. Unity 平台宏定义

    官方文档: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

  3. cocos2d-x C++ 判断当前平台宏定义大全

    /**************************************************************************** Copyright (c) 2010-201 ...

  4. Unity各平台内置宏定义

    属性 方法 UNITY_EDITOR #define directive for calling Unity Editor scripts from your game code. UNITY_EDI ...

  5. Unity3D 多平台 预编译 宏定义

    平台定义 UNITY_EDITOR 编辑器调用. UNITY_STANDALONE_OSX 专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义. UN ...

  6. Unity3D 多平台_预编译相关宏定义

    http://www.cnblogs.com/zhaoqingqing/p/3510332.html API地址:http://docs.unity3d.com/Documentation/Manua ...

  7. Linux Kernel代码艺术——系统调用宏定义

    我们习惯在SI(Source Insight)中阅读Linux内核,SI会建立符号表数据库,能非常方便地跳转到变量.宏.函数等的定义处.但在处理系统调用的函数时,却会遇到一些麻烦:我们知道系统调用函数 ...

  8. VC中预处理指令与宏定义详解

    刚接触到MFC编程的人往往会被MFC 向导生成的各种宏定义和预处理指令所吓倒,但是预处理和宏定义又是C语言的一个强大工具.使用它们可以进行简单的源代码控制,版本控制,预警或者完成一些特殊的功能. 一个 ...

  9. C中的预编译宏定义

     可以用宏判断是否为ARC环境 #if _has_feature(objc_arc) #else //MRC #endif C中的预编译宏定义 -- 作者: infobillows 来源:网络 在将一 ...

随机推荐

  1. 业务领域建模Domain Modeling

    我的工程实践选题为ESP32低功耗的实现,本项目基于ESP32嵌入式开发平台.下文将以需求为基础,对该项目进行领域建模. 一.概念介绍 1.业务建模 1.1 概念介绍 业务建模(Business Mo ...

  2. kafka connector 使用总结以及自定义connector开发

    Kafaka connect 是一种用于在Kafka和其他系统之间可扩展的.可靠的流式传输数据的工具.它使得能够快速定义将大量数据集合移入和移出Kafka的连接器变得简单.Kafka Connect可 ...

  3. 笔记本进入BIOS设置

    转眼间,到大三了. 在学习<Red Hat Linux 服务器搭建与管理>这门课时,刚开学第一节,就是虚拟机,但是最烦恼的是我们笔记本电脑的默认设置,它把虚拟化给禁止了. 1,首先,我们需 ...

  4. PostGIS 爆管分析之找出总阀门

    这个算法算是被摒弃了,但是很多自己思考过后留下的成果,虽然不用了,留着做记录. 算法目的是为了发生爆管后找到总阀门,这里分了几个步骤: 1.找到爆管点所在管段 2.通过遍历找到爆管点所有影响的阀门 3 ...

  5. 读懂JWT的使用,你就会用PHP如何实现了

    要如何用php实现JWT认证,那我们首先就来认识一下什么是JWT.什么是JWTJWT(json web token)是为了在网络应用环境间传递声明而执行的一种基于JSON的开放标准.JWT的声明一般被 ...

  6. oracle中两个服务器连接中sys密码修改问题

    问题描述:orcl服务器要连接orclstd 想要sqlplus sys/410526@orclstd as sysdba 连接orclstd数据库,但是发现啥意思密码不对,就对sys密码进行重新设置 ...

  7. Linux服务和systemctl详解

    定义 A Linux service is an application (or set of applications) that runs in the background waiting to ...

  8. 深入理解.NET Core的基元(三) - 深入理解runtimeconfig.json

    原文:Deep-dive into .NET Core primitives, part 3: runtimeconfig.json in depth 作者:Nate McMaster 译文:深入理解 ...

  9. spark graphX作图计算

    一.使用graph做好友推荐 import org.apache.spark.graphx.{Edge, Graph, VertexId} import org.apache.spark.rdd.RD ...

  10. Django REST framework(DRF)

    Django REST framework(DRF) FBV与CBV CBV源码分析 Restful接口规范 DRF简单配置使用和源码解析 DRF序列化器 DRF10大接口 DRF视图集 三大组件 j ...