Unity3d判断当前编译平台
2013-10-25 15:10
459 查看
Platform Dependent Compilation
Unity includes a feature named "Platform Dependent Compilation". This consists of some preprocessor directives that let you partition your scripts to compile and execute a section of code exclusively for one of the supportedplatforms.
Furthermore, you can run this code within the Editor, so you can compile the code specifically for your mobile/console and test it in the Editor!
Platform Defines
The platform defines that Unity supports for your scripts are:UNITY_EDITOR | Define for calling Unity Editor scripts from your game code. |
UNITY_STANDALONE_OSX | Platform define for compiling/executing code specifically for Mac OS (This includes Universal, PPC and Intel architectures). |
UNITY_DASHBOARD_WIDGET | Platform define when creating code for Mac OS dashboard widgets. |
UNITY_STANDALONE_WIN | Use this when you want to compile/execute code for Windows stand alone applications. |
UNITY_STANDALONE_LINUX | Use this when you want to compile/execute code for Linux stand alone applications. |
UNITY_STANDALONE | Use this to compile/execute code for any standalone platform (Mac, Windows or Linux). |
UNITY_WEBPLAYER | Platform define for web player content (this includes Windows and Mac Web player executables). |
UNITY_WII | Platform define for compiling/executing code for the Wii console. |
UNITY_IPHONE | Platform define for compiling/executing code for the iPhone platform. |
UNITY_ANDROID | Platform define for the Android platform. |
UNITY_PS3 | Platform define for running PlayStation 3 code. |
UNITY_XBOX360 | Platform define for executing Xbox 360 code. |
UNITY_NACL | Platform define when compiling code for Google native client (this will be set additionally to UNITY_WEBPLAYER). |
UNITY_FLASH | Platform define when compiling code for Adobe Flash. |
UNITY_BLACKBERRY | Platform define for a Blackberry10 device. |
UNITY_WP8 | Platform define for Windows Phone 8. |
UNITY_METRO | Platform define for Windows Store Apps (additionally NETFX_CORE is defined when compiling C# files against .NET Core). |
相关文章推荐
- unity3d 4.3中新的开发工具2d游戏开发系统的初体验
- Unity3D学习笔记
- Unity3d 记录1
- UNITY + OpenCVSharp调节图像对比度
- [Unity3d]NGUI的INPUT输入框限制中文字节数问题
- unity3d学习笔记(十八)--利用C#的代理和事件结合NGUI的按钮实现施放技能
- unity3d 游戏对象消失三种方法的区别(enabled/Destroy/active)
- C# delegate , Unity3D 如何应用指针
- Unity3D 4.0新功能:Mecanim动画系统基础教程
- Unity3d 4.0新动画系统Mecanim用法(二)
- Unity3D学习历程之Rigidbody函数
- UNITY3D物理引擎Rigidbody,Collider,PhysicMaterial的整理
- VS2012开发Unity3d的编码问题
- Unity3D深度相机 Depth Camera
- 【Unity3d学习之一】Unity3d异常报错的处理
- Unity界面插件NGUI核心组件说明
- Unity基本语法
- Unity3d 4.0新动画系统Mecanim初探(一)
- unity3d学习笔记(十七)--unity3d读取csv文件
- Unity3d C# Timer定时器的使用