Unity 平台相关宏定义

Platform Defines Macros

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_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.

Also you can compile code selectively depending on the version of the engine you are working on. Currently the supported ones are:

UNITY_2_6 Platform define for the major version of Unity 2.6.
UNITY_2_6_1 Platform define for specific version 1 from the major release 2.6.
UNITY_3_0 Platform define for the major version of Unity 3.0.
UNITY_3_0_0 Platform define for the specific version 0 of Unity 3.0.
UNITY_3_1 Platform define for major version of Unity 3.1.
UNITY_3_2 Platform define for major version of Unity 3.2.
UNITY_3_3 Platform define for major version of Unity 3.3.
UNITY_3_4 Platform define for major version of Unity 3.4.
UNITY_3_5 Platform define for major version of Unity 3.5.
UNITY_4_0 Platform define for major version of Unity 4.0.

Unity官方文档地址

时间: 2024-07-30 15:18:09

Unity 平台相关宏定义的相关文章

process调用protothread机制的相关宏定义——用HelloWorld进程诠释

HelloWorld例子 #include "contiki.h" #include <stdio.h> /* For printf() */ /*---------------------------------------------------------------------------*/ PROCESS(hello_world_process, "Hello world process"); AUTOSTART_PROCESSES(&

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

预编译 原文地址:http://docs.unity3d.com/Documentation/Manual/PlatformDependentCompilation.html 平台定义     UNITY_EDITOR 编辑器调用. UNITY_STANDALONE_OSX 专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义. UNITY_DASHBOARD_WIDGET Mac OS Dashboard widget (Mac OS仪表板小部件

windows 下使用thread_create相关宏定义

#ifdef _WIN32 #include <windows.h> extern "C" {     extern int getopt(int, char * const *, const char *);     extern char *optarg; } #define PATHD '\\' typedef HANDLE thread_t; #define thread_create(thrp, attr, func, arg)                  

UI控件相关宏定义

1.显示设置 1.1 view圆角和边框 /** 设置view圆角和边框 */ #define kViewBorderRadius(View, Radius, Width, Color)[View.layer setCornerRadius:(Radius)];[View.layer setMasksToBounds:YES];[View.layer setBorderWidth:(Width)];[View.layer setBorderColor:[Color CGColor]] 1.2 设

unity平台的预处理(宏的定义)

在unity的跨平台中,我们常常会在各个平台游走,如安卓版,苹果版,PC版.在不同的平台上,我们要做不同的操作.然而我们可以使用unity的自带的宏定义来做平台的判断.Unity帮我们定义了例如以下平台预处理.(还有一些版本号的宏定义,这里没有写出来.) 我们使用#if #elif #endif进行宏命令的判断,unity会自己判断哪些条件成立,然后执行指定的代码.例子如下: 此外,我们还可以自己对宏命令进行定义:在edit-project settings-player中的设定栏可以添加属于自

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 directi

Unity3D -- 平台宏定义

官方文档网址:https://docs.unity3d.com/Manual/PlatformDependentCompilation.html Property: Function:UNITY_EDITOR Unity编辑器UNITY_EDITOR_WIN Windows 操作系统.UNITY_EDITOR_OSX macos操作系统UNITY_STANDALONE_OSX 专门为macos(包括Universal, PPC,Intel architectures)平台的定义UNITY_STA

unity平台的预处理

unity平台的预处理 在开发中,特别是unity的跨平台中,我们经常会在各个平台游走,如安卓版,苹果版,PC版.......在此不同的平台上,有可能我们需要做不同的操作.然而我们就可以用unity的自带的平台宏定义方式来做平台的判断.Unity帮我们定义了如下平台预处理:  名称  描述 UNITY_EDITOR Define for calling Unity Editor scripts from your game code. UNITY_STANDALONE_OSX Platform

(一)预定义宏、__func__、_Pragma、变长参数宏定义以及__VA_ARGS__

作为第一篇,首先要说一下C++11与C99的兼容性. C++11将 对以下这些C99特性的支持 都纳入新标准中: 1) C99中的预定义宏 2) __func__预定义标识符 3) _Pragma操作符 4) 不定参数宏定义以及__VA_ARGS__ 5) 宽窄字符串连接 这些特性并不像语法规则一样常用,并且有的C++编译器实现也都先于标准地将这些特性实现,因此可能大多数程序员没有发现这些不兼容.但将这些C99的特性在C++11中标准化无疑可以更广泛地保证两者的兼容性.我们来分别看一下. 这次,