반응형
Notice
Recent Posts
Recent Comments
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

Do Something IT

[unity] 컴파일시 플랫폼 구분 방법 본문

Unity3D

[unity] 컴파일시 플랫폼 구분 방법

아낙시만더 2012. 10. 8. 11:53
반응형

전처리 소스 구분 코드


#if (UNITY_ANDROID || UNITY_IPHONE) 
폰용 소스 
#else 
다른 플랫폼 소스 
#endif 

위와 같이 전처리기를 이용해서 컴파일 할 때 해당되는 소스를 아에 인식못하게 하는 방법이 있습니다. 
유니티의 전처리기에서 플랫폼을 구분하는 값은 다음과 같습니다. 

//// 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_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 Play Station 3 code. 
//// UNITY_XBOX360 Platform define for executing XBbox 360 code. 


비전처리 소스

preference info

function Start () {
if (Application.platform == RuntimePlatform.WindowsPlayer)
print ("Do something special here!");
}


RuntimePlatform


OSXEditor

Mac OS X에서 일치 편집기에서 .

OSXPlayer

Mac OS X의 플레이어에서

WindowsPlayer

윈도우에서 플레이어에서 .

OSXWebPlayer

Mac OS X에서 웹 플레이어에서 .

OSXDashboardPlayer

Mac OS X에서 대시보드 위젯 있음 .

WindowsWebPlayer

Windows에서 웹 플레이어에서.

WiiPlayer

닌텐도 Wii의 플레이어에서 .

WindowsEditor

윈도우에서 일치 편집기에서 .

IPhonePlayer

아이폰에있는 플레이어에서 .

XBOX360

XBOX360에서 플레이어에서

PS3

플레이 스테이션 3의 플레이어에서

Android

안드로이드 장치에서 플레이어에서 .

반응형
Comments