Unity3D -- 平台宏定义
来源:互联网 发布:java免费发送短信插件 编辑:程序博客网 时间:2024/06/06 08:51
官方文档网址:https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
本文章转译自官方文档
代码实例C#:
// C#using UnityEngine;using System.Collections;public class PlatformDefines : MonoBehaviour { void Start () { #if UNITY_EDITOR Debug.Log("Unity Editor"); #endif #if UNITY_IOS Debug.Log("Iphone"); #endif #if UNITY_STANDALONE_OSX Debug.Log("Stand Alone OSX"); #endif #if UNITY_STANDALONE_WIN Debug.Log("Stand Alone Windows"); #endif } }
可以使用#if #elif
#if UNITY_EDITOR Debug.Log("Unity Editor");#elif UNITY_IOS Debug.Log("Unity iPhone");#else Debug.Log("Any other platform");#endif
可以自定义宏定义,打开Other Settings窗口,选择Player Settings > Scripting Define Symbols阅读全文
0 0
- Unity3d 平台宏定义
- Unity3D -- 平台宏定义
- Unity3D 多平台_预编译相关宏定义
- Unity3D 多平台_预编译相关宏定义
- Unity3d 多平台_预编译相关宏定义
- Unity3D 多平台_预编译相关宏定义
- 【Unity3D自学记录】Unity3D宏定义
- 跨平台宏定义
- Unity平台宏定义
- #ifdef 跨平台宏定义
- unity中宏定义平台
- unity多平台宏定义
- Unity3D 预编译相关宏定义
- 平台定义
- Unity3D中 TRANSFORM_TEX 定义
- 跨平台开发,各种宏的定义
- 跨平台开发,各种宏的定义
- c++各个平台的宏定义
- (二)Android官方MVVM框架实现组件化之ARouter串联各模块
- LightOJ
- 一个菜鸟的前端之路
- bootstrap引入插件无效
- Javascript——布尔值、关系运算符、逻辑运算符
- Unity3D -- 平台宏定义
- linux 0.11 内核分析
- ROS 编译rgbdslam_v2报错:AttributeError: module 'em' has no attribute 'Interpreter'
- BesTV R3300-M挂载System分区方法
- hadoop的单节点伪分布安装步骤
- redis 主从复制
- Find K Closest Elements
- ssm框架创建简单的DVD管理系统(三)bootstrap的导入和web.xml及spring mvc配置
- 聊聊电商行业技术特点