PlatformProvider
A static class in Alta.PlatformInformation.Runtime, Alta.PlatformInformation.
Static helper that tells which platform the game is running on (Windows, Linux, Android, Quest, Pico), with an optional client override for testing.
- Listed in Other Alta assemblies
- Attributes
Extension
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private const string AndroidName | Name returned for Android. |
private const string AndroidPreviewName | Name returned for Android preview. |
private const string LinuxName | Name returned for Linux. |
private static readonly LocalPlatformProvider LocalProvider | Detects the real platform. |
private static readonly OverridePlatformProvider OverrideProvider | Holds the client runtime override, if set. |
private const string PicoName | Name returned for Pico. |
private const string QuestName | Name returned for Quest. |
private const string UnknownName | Name returned for an unknown platform. |
private const string WindowsName | Name returned for Windows. |
Properties
| Member | What it is |
|---|---|
static PlatformFlags PlatformFlags { get; } | The current platform: the override if one is set, otherwise the detected one. |
static string PlatformName { get; } | The current platform as a string, such as "Quest" or "Windows". |
Events
| Member | What it is |
|---|---|
static event Action OnOverrideRuntimePlatform | Raised after SetClientRuntimeOverride changes the reported platform. |
Methods
| Member | What it is |
|---|---|
static void ClearClientRuntimeOverride() | Removes the runtime override so the real platform is reported again. |
static bool IsActiveRuntime(PlatformFlags input) | Extension: true if the current platform matches the given flags. |
static bool IsAndroid() | True on Quest or Pico. On a plain Android runtime it returns false, because of how the flag check works. |
static bool IsAndroidOrAndroidPreview() | True for IsAndroid or IsAndroidPreview. |
static bool IsAndroidPreview() | True when running as Android preview. |
static bool IsClient() | True on anything except Linux. |
static bool IsLinux() | True on the Linux platform. |
static bool IsPico() | True on Pico. |
static bool IsQuest() | True on Quest. |
static bool IsServer() | True on Linux. The dedicated server is the Linux build, so this is a platform check, not a network role. |
static bool IsWindows() | True on Windows. |
static void SetClientRuntimeOverride(PlatformFlags runtime) | Makes the game report a different platform and raises OnOverrideRuntimePlatform. Throws for plain Android; use Quest or Pico. |
2 private and internal methods
| Member | What it is |
|---|---|
private static bool HasFlag(PlatformFlags input) | True if the current platform matches any of the given flags. Treats the Android bit as matching Quest and Pico. |
private static bool IsAndroidSubPlatform(PlatformFlags input) | True if the given flags mean Android in general and the platform is Quest or Pico. |