RuntimePlatform
The platform application is running. Returned by Application.platform.
Read time 2 minutesLast updated 2 days ago
Definition
- Type: Enum
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public enum RuntimePlatform
Remarks
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.
Fields
Value | Description |
|---|---|
| Android | In the player on Android devices. |
| EmbeddedLinuxArm64 | In the player on EmbeddedLinuxArm64. |
| EmbeddedLinuxX64 | In the player on EmbeddedLinuxX64. |
| GameCoreXboxOne | In the player on GameCoreXboxOne. |
| GameCoreXboxSeries | In the player on GameCoreXboxSeries. |
| IPhonePlayer | In the player on iPhone or iPad devices. |
| LinuxEditor | In the Unity editor on Linux. |
| LinuxPlayer | In the player on Linux. |
| LinuxServer | In the server on Linux. |
| OSXEditor | In the Unity editor on macOS. |
| OSXPlayer | In the player on macOS. |
| OSXServer | In the server on macOS. |
| PS4 | In the player on the Playstation 4. |
| PS5 | In the player on the Playstation 5. |
| QNXArm64 | In the player on QNXArm64. |
| QNXX64 | In the player on QNXX64. |
| Switch | In the player on Nintendo Switch. |
| Switch2 | In the player on Nintendo Switch 2. |
| VisionOS | In the player on visionOS. |
| WebGLPlayer | In the player on WebGL |
| WindowsEditor | In the Unity editor on Windows. |
| WindowsPlayer | In the player on Windows. |
| WindowsServer | In the server on Windows. |
| WSAPlayerARM | In the player on Windows Store Apps when CPU architecture is ARM. |
| WSAPlayerX64 | In the player on Windows Store Apps when CPU architecture is X64. |
| WSAPlayerX86 | In the player on Windows Store Apps when CPU architecture is X86. |
| XboxOne | In the player on Xbox One. |