Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

AndroidIn the player on Android devices.
EmbeddedLinuxArm64In the player on EmbeddedLinuxArm64.
EmbeddedLinuxX64In the player on EmbeddedLinuxX64.
GameCoreXboxOneIn the player on GameCoreXboxOne.
GameCoreXboxSeriesIn the player on GameCoreXboxSeries.
IPhonePlayerIn the player on iPhone or iPad devices.
LinuxEditorIn the Unity editor on Linux.
LinuxPlayerIn the player on Linux.
LinuxServerIn the server on Linux.
OSXEditorIn the Unity editor on macOS.
OSXPlayerIn the player on macOS.
OSXServerIn the server on macOS.
PS4In the player on the Playstation 4.
PS5In the player on the Playstation 5.
QNXArm64In the player on QNXArm64.
QNXX64In the player on QNXX64.
SwitchIn the player on Nintendo Switch.
Switch2In the player on Nintendo Switch 2.
VisionOSIn the player on visionOS.
WebGLPlayerIn the player on WebGL
WindowsEditorIn the Unity editor on Windows.
WindowsPlayerIn the player on Windows.
WindowsServerIn the server on Windows.
WSAPlayerARMIn the player on Windows Store Apps when CPU architecture is ARM.
WSAPlayerX64In the player on Windows Store Apps when CPU architecture is X64.
WSAPlayerX86In the player on Windows Store Apps when CPU architecture is X86.
XboxOneIn the player on Xbox One.