Unity3d Tutorial : Application Class Part 3 - platform
Unity3D 2012. 6. 13. 14:26http://file:///Applications/Unity/Documentation/ScriptReference/Application-platform.html
static var platform : RuntimePlatform
Description
Returns the platform the game is running (Read Only).
Use this property if you absolutely need to do some platform dependent work. See Also: RuntimePlatform
플랫폼이 몬지 반환한다. RuntimePlatform 을 함께 봐야 함
using System.Collections;
public class example : MonoBehaviour {
void Start() {
if (Application.platform == RuntimePlatform.WindowsPlayer)
print("Do something special here!");
}
}
http://file:///Applications/Unity/Documentation/ScriptReference/RuntimePlatform.html
The platform application is running. Returned by Application.platform.
Note: The difference between using RuntimePlatform and Platform dependent Compilation is that using RuntimePlatform is evaluated at runtime while Platform dependent Compilation is evaluated at compile time. So if you can use platform dependent compilation, don't hesitate to use it. In most cases, you can get the same functionality using both, and using the defines will produce smaller and faster code, as you don't need to check at runtime. There are some cases where RuntimePlatform is needed, for example: if you need to check which platform you are running a webplayer you may check this at runtime.
OSXEditor | In the Unity editor on Mac OS X. |
OSXPlayer | In the player on Mac OS X. |
WindowsPlayer | In the player on Windows. |
OSXWebPlayer | In the web player on Mac OS X. |
OSXDashboardPlayer | In the Dashboard widget on Mac OS X. |
WindowsWebPlayer | In the web player on Windows. |
WiiPlayer | In the player on Nintendo Wii. |
WindowsEditor | In the Unity editor on Windows. |
IPhonePlayer | In the player on the iPhone. |
XBOX360 | In the player on the XBOX360 |
PS3 | In the player on the Play Station 3 |
Android | In the player on Android devices. |
'Unity3D' 카테고리의 다른 글
Unity3d Tutorial: Application Class Part5 - targetFrameRate (0) | 2012.06.13 |
---|---|
Unity3d Tutorial: Application Class Part4 - unityVersion (0) | 2012.06.13 |
Unity3d Tutorial: Application Class Part 3 - isEditor (0) | 2012.06.13 |
Unity3D Tutorial : Application Class Part1 - runInBackground (0) | 2012.06.13 |
Unity3d Tutorial - Player Movement 2.0 (0) | 2012.06.12 |