Version: 2022.2
LanguageEnglish
  • C#

RuntimePlatform

enumeration

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

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> 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 at runtime.

Properties

OSXEditorIn the Unity editor on macOS.
OSXPlayerIn the player on macOS.
WindowsPlayerIn the player on Windows.
WindowsEditorIn the Unity editor on Windows.
IPhonePlayerIn the player on the iPhone.
AndroidIn the player on Android devices.
LinuxPlayerIn the player on Linux.
LinuxEditorIn the Unity editor on Linux.
WebGLPlayerIn the player on WebGL
WSAPlayerX86In the player on Windows Store Apps when CPU architecture is X86.
WSAPlayerX64In the player on Windows Store Apps when CPU architecture is X64.
WSAPlayerARMIn the player on Windows Store Apps when CPU architecture is ARM.
PS4In the player on the Playstation 4.
XboxOneIn the player on Xbox One.
tvOSIn the player on the Apple's tvOS.
SwitchIn the player on Nintendo Switch.
StadiaIn the player on Stadia.
PS5In the player on the Playstation 5.
LinuxServerIn the server on Linux.
WindowsServerIn the server on Windows.
OSXServerIn the server on macOS.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961