Unity3d Tutorial : Application Class Part 3 - platform

Unity3D 2012. 6. 13. 14:26
반응형

http://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 을 함께 봐야 함 

C#
using UnityEngine;
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.

반응형
: