Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

RuntimePlatform

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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.

Variables

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.
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.
LinuxPlayer In the player on Linux.
FlashPlayer Flash Player.
WP8Player In the player on Windows Phone 8 device.
PSP2 In the player on the PS Vita.
PS4 In the player on the Playstation 4.
PSMPlayer In the player on the PSM.
XboxOne In the player on Xbox One.
SamsungTVPlayer In the player on Samsung Smart TV.