Skip to main content

PlayerModeUtilities

A static class in Root.Township, the global namespace.

Static helper that works out the player mode (Quest, Pico, OpenXR, OpenVR, Fly and so on) from the platform, an override and the command line.

Fields​

2 private and internal fields
MemberWhat it is
private static PlayerMode currentCached mode worked out on first read.
private static readonly IEnumerable<PlayerMode> forbiddenSaveModesAutoCam and Fly.

Properties​

MemberWhat it is
static PlayerMode OverrideMode { get; set; }Mode forced by code. Wins over everything except the Android platform check.
static PlayerMode PlayerMode { get; }The current mode: Quest or Pico on Android, then OverrideMode, then the cached value, then /fly or the XR mode from the command line.

Methods​

MemberWhat it is
static bool IsNormalPlayerMode(PlayerMode playerMode)False for AutoCam and Fly, which are modes that shouldn't be saved.
2 private and internal methods
MemberWhat it is
private static PlayerMode GetEditorMode(PlayerMode input)Returns the input unchanged in this build.
private static bool TryGetPlayerModeForAndroid(out PlayerMode playerMode)Picks PicoXR or MetaQuest from the platform.