http://docs.unity3d.com/kr/current/Manual/PlatformDependentCompilation.html
http://docs.unity3d.com/ScriptReference/RuntimePlatform.html
- 전처리 소스 구분 코드
1 2 3 4 5 | #if (UNITY_ANDROID || UNITY_IPHONE) 폰용 소스 #else 다른 플랫폼 소스 #endif |
- 비 전처리 소스 구분 코드
1 2 | if (Application.platform == RuntimePlatform.WindowsPlayer) print ("Do something special here!"); |
플랫폼 매크로 정의
Unity 스크립트에서 지원하는 플랫폼 매크로 정의 :
프로퍼티: | 기능: |
UNITY_EDITOR | Unity 스크립트에서 지원하는 플랫폼 매크로 정의 : |
UNITY_EDITOR_WIN | Windows에서의 플랫폼 정의 에디터 코드. |
UNITY_EDITOR_OSX | Mac OSX에서의 플랫폼 정의 에디터 코드. |
UNITY_STANDALONE_OSX | Mac OS (Univeral, PPC 및 Intel 아키텍처 포함) 의 코드 컴파일 / 실행을 위한 플랫폼 매크로 정의. |
UNITY_STANDALONE_WIN | Windows 독립 실행형 응용 프로그램 코드를 컴파일 / 실행하고 싶을 때 사용합니다. |
UNITY_STANDALONE_LINUX | Linux 독립 실행형 응용 프로그램 코드를 컴파일 / 실행하고 싶을 때 사용합니다. |
UNITY_STANDALONE | 모든 독립 실행형 응용 프로그램(Mac, Windows 또는 Linux)의 코드를 컴파일 / 실행하고 싶을 때 사용합니다. |
UNITY_WEBPLAYER | Web Player 콘텐츠(Windows 및 Mac Web Player 실행 파일을 포함합니다) 플랫폼 매크로 정의. |
UNITY_WII | Wii 콘솔 코드 컴파일 / 실행을 위한 플랫폼 매크로 정의. |
UNITY_IOS | iOS 플랫폼에서 코드 컴파일/실행을 위한 플랫폼 매크로 정의 |
UNITY_IPHONE | Deprecated. Use UNITY_IOS instead. |
UNITY_ANDROID | Android 플랫폼의 플랫폼 매크로 정의. |
UNITY_PS3 | PlayStation 3에서 코드 컴파일 / 실행을 위한 플랫폼 매크로 정의. |
UNITY_PS4 | PlayStation 4에서 코드 컴파일 / 실행을 위한 플랫폼 매크로 정의. |
UNITY_XBOX360 | XBox 360 코드의 컴파일 / 실행을 위한 플랫폼 매크로 정의. |
UNITY_XBOXONE | XBox One 코드의 컴파일 / 실행을 위한 플랫폼 매크로 정의. |
UNITY_BLACKBERRY | Blackberry10 장치를 위한 플랫폼 매크로 정의. |
UNITY_WP8 | Windows Phone 8 플랫폼 매크로 정의. |
UNITY_WP8_1 | Windows Phone 8.1 플랫폼 매크로 정의. |
UNITY_WSA | Platform define for Windows Store Apps (additionally NETFX_CORE is defined when compiling C# files against .NET Core). |
UNITY_WSA_8_0 | SDK 8.0을 타케팅했을 때의 Windows Store Apps 플랫폼 매크로 정의. |
UNITY_WSA_8_1 | SDK 8.1을 타케팅했을 때의 Windows Store Apps 플랫폼 매크로 정의. |
UNITY_WINRT | Equivalent to UNITY_WP8 | UNITY_WSA. |
UNITY_WINRT_8_0 | Equivalent to UNITY_WP8 | UNITY_WSA_8_0. |
UNITY_WINRT_8_1 | Equivalent to UNITY_WP_8_1 | UNITY_WSA_8_1. It's also defined when compiling against Universal SDK 8.1. |
UNITY_WEBGL | WebGL 플랫폼 매크로 정의. |
또한 작업을 하고 있는 Unity 엔진 버전에 따라 코드를 선택적으로 컴파일할 수 있습니다. 현재 지원되고 있는 것은 :
UNITY_2_6 Unity 2.6 버전의 플랫폼 매크로 정의. UNITY_2_6_1 Unity 2.6.1 버전의 플랫폼 매크로 정의. UNITY_3_0 Unity 3.0 버전의 플랫폼 매크로 정의. UNITY_3_0_0 Unity 3.0.0 버전의 플랫폼 매크로 정의. UNITY_3_1 Unity 3.1 버전의 플랫폼 매크로 정의. UNITY_3_2 Unity 3.2 버전의 플랫폼 매크로 정의. UNITY_3_3 Unity 3.3 버전의 플랫폼 매크로 정의. UNITY_3_4 Unity 3.4 버전의 플랫폼 매크로 정의. UNITY_3_5 Unity 3.5 버전의 플랫폼 매크로 정의. UNITY_4_0 Unity 4.0 버전의 플랫폼 매크로 정의. UNITY_4_0_1 Unity 4.0.1 버전의 플랫폼 매크로 정의. UNITY_4_1 Unity 4.1 버전의 플랫폼 매크로 정의. UNITY_4_2 Unity 4.2 버전의 플랫폼 매크로 정의. UNITY_4_3 Unity 4.3 버전의 플랫폼 매크로 정의. UNITY_4_5 Unity 4.5 버전의 플랫폼 매크로 정의. UNITY_4_6 Unity 4.6 버전의 플랫폼 매크로 정의. UNITY_5_0 Unity 5.0 버전의 플랫폼 매크로 정의.
RuntimePlatform
In the Unity editor on Mac OS X. | |
In the player on Mac OS X. | |
In the player on Windows. | |
In the web player on Mac OS X. | |
In the Dashboard widget on Mac OS X. | |
In the web player on Windows. | |
In the Unity editor on Windows. | |
In the player on the iPhone. | |
In the player on the XBOX360. | |
In the player on the Play Station 3. | |
In the player on Android devices. | |
In the player on Linux. | |
In the player on WebGL? | |
In the player on Windows Store Apps when CPU architecture is X86. | |
In the player on Windows Store Apps when CPU architecture is X64. | |
In the player on Windows Store Apps when CPU architecture is ARM. | |
In the player on Windows Phone 8 device. | |
In the player on Tizen. | |
In the player on the PS Vita. | |
In the player on the Playstation 4. | |
In the player on Xbox One. | |
In the player on Samsung Smart TV. |
'Unity' 카테고리의 다른 글
System.IO.FileInfo' does not contain a definition for `Directory' and no extension method `Directory' of type `System.IO.FileInfo' could be found (0) | 2015.08.31 |
---|---|
회사원 쪼꼬두유 (0) | 2015.08.05 |
Unity 모바일 시스템 언어 갖고오기 (0) | 2015.08.05 |
NGUI DropDown Menu 만들기 (0) | 2015.08.05 |
Mouse좌표를 NGUI 카메라 좌표로 바꾸는 법 (0) | 2015.07.24 |