MenuSettings
A class in Root.Township, the global namespace.
Global settings asset for the menu and startup: scene names, server list colours and materials, selection orb tuning and editor-only startup flags. Get it with GlobalSettings<MenuSettings>.Instance.
- Listed in Global namespace: M to O
- Inherits or implements
GlobalSettings<MenuSettings> - Derived types
MenuSettings,MenuSettings.Create - Nested types
AfterStartActionType,Create,MenuType - Attributes
GlobalSettings
Constructors
| Member | What it is |
|---|---|
MenuSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|---|
int bundleVersionCode | Build bundle version code stored on the asset. |
bool isAlwaysOnFocus | Editor only: makes the game act as if the window always has focus. |
32 private and internal fields
| Member | What it is |
|---|---|
private MenuSettings.AfterStartActionType afterStartAction | Backing field for AfterStartAction. |
private AnimationCurve distanceToHapticStrength | Backing field for DistanceToHapticstrength. |
private AnimationCurve distanceToScreenFade | Backing field for DistanceToScreenFade. |
private Material elementNormalMaterial | Backing field for ElementNormalMaterial. |
private Material elementSelectedMaterial | Backing field for ElementSelectedMaterial. |
private Color emptyPingBarColor | Backing field for EmptyPingBarColor. |
private string[] gameScenes | Backing field for GameScenes. |
private static TaskCompletionSource<GameObject> instantiatingPlatformManagerTask | Pending load of the platform manager, so parallel calls to InstantiatePlatformManagerAsync wait for one load. |
private bool isClearingSaveWhenDirectLaunching | Whether local test saves are cleared on direct launch. |
private bool isDisablingAstarCalculation | Backing field for IsDisablingAstarCalculation. |
private bool isDisablingOculusServicesInEditor | Backing field for IsDisablingOculusServicesInEditor. |
private bool isForcedHeadless | Backing field for IsForcedHeadless. |
private bool isJoiningTutorialFirstTimeInEditor | Backing field for IsJoiningTutorialFirstTimeInEditor. |
private bool isRequestingOwnedItemsInEditor | Backing field for IsRequestingOwnedItemsInEditor. |
private int[] minPingPerLevel | Backing field for MinPingPerLevel; defaults to 35, 100 and 250 ms. |
private float minPointerPrefabSizeForInflation | Backing field for MinPointerPrefabSizeForInflation. |
private string noInternetScene | Backing field for NoInternetScene. |
private Gradient pingBarColor | Backing field for PingBarColor. |
private Color pingColorHighlight | Backing field for PingColorHighlight. |
private static GameObject platformManager | The platform manager object, loaded once from Addressables and kept across scenes. |
private Gradient playabilityColorGradient | Backing field for PlayabilityColorGradient. |
private float pointerPrefabInflationMultiplier | Backing field for PointerPrefabInflationMultiplier. |
private string registrationScene | Backing field for RegistrationScene. |
private Material selectionOrbInFaceMaterial | Backing field for SelectionOrbInFaceMaterial. |
private Material selectionOrbInvalidMaterial | Backing field for SelectionOrbInvalidMaterial. |
private float selectionOrbLetGoThreshold | Backing field for SelectionOrbLetGoThreshold. |
private Material selectionOrbValidMaterial | Backing field for SelectionOrbValidMaterial. |
private bool startLocalTestOnServerJoinFail | Backing field for StartLocalTestOnServerJoinFail. |
private bool startMenuSceneOnServerJoinFail | Backing field for StartMenuSceneOnServerJoinFail. |
private Color toggleOffColor | Backing field for ToggleOffColor. |
private Color toggleOnColor | Backing field for ToggleOnColor. |
private string vrMenuScene | Backing field for MenuSceneName. |
Properties
| Member | What it is |
|---|---|
MenuSettings.AfterStartActionType AfterStartAction { get; set; } | What the game does after startup in a dev build (none, local test, local server, join local server). Read only in debug inspector. |
AnimationCurve DistanceToHapticstrength { get; } | Curve from distance to haptic strength, used by the menu selection orbs. |
AnimationCurve DistanceToScreenFade { get; } | Curve from distance to screen fade amount, used by the menu selection orbs. |
Material ElementNormalMaterial { get; } | Material for a server list element that is not selected. |
Material ElementSelectedMaterial { get; } | Material for the selected server list element. |
Color EmptyPingBarColor { get; } | Colour of the unfilled bars in a server's ping indicator. |
string[] GameScenes { get; } | Names of the scenes that can be loaded as a game world. |
bool IsDisablingAstarCalculation { get; } | Editor only: skips A* pathfinding work in play mode to start faster, which stops creature pathfinding. |
bool IsDisablingOculusServicesInEditor { get; } | Editor only: skips Oculus services startup in play mode to start faster. |
bool IsForcedHeadless { get; } | Forces headless mode. |
bool IsJoiningTutorialFirstTimeInEditor { get; } | Editor only: whether a first-time player is sent to the tutorial. |
bool IsRequestingOwnedItemsInEditor { get; } | Editor only: whether to fetch the player's owned items. |
int LocalGameScene { get; } | Index in GameScenes of the active scene, or -1 (with an error log) if it is not a game scene. |
string LocalGameSceneName { get; } | Name of the active game scene, from GameScenes at LocalGameScene. |
string MenuSceneName { get; } | Name of the VR main menu scene. |
int[] MinPingPerLevel { get; } | Ping thresholds in ms for each ping bar level (default 35, 100, 250). |
float MinPointerPrefabSizeForInflation { get; } | Minimum pointer bounds size before PointerPrefabInflationMultiplier is applied. |
string NoInternetScene { get; } | Name of the scene shown when there is no internet connection. |
Gradient PingBarColor { get; } | Gradient used to colour the ping bars. |
Color PingColorHighlight { get; } | Highlight colour for the ping indicator. |
Gradient PlayabilityColorGradient { get; } | Gradient a server element evaluates with the server's playability value to pick its colour. |
float PointerPrefabInflationMultiplier { get; } | How much pointer target bounds are scaled up to make small objects easier to point at. |
string RegistrationScene { get; } | Name of the account registration scene. |
Material SelectionOrbInFaceMaterial { get; } | Material for a menu selection orb held close to the face. |
Material SelectionOrbInvalidMaterial { get; } | Material for a menu selection orb in an invalid spot. |
float SelectionOrbLetGoThreshold { get; } | Distance from the head within which a held action orb counts as used when let go. |
Material SelectionOrbValidMaterial { get; } | Material for a menu selection orb in a valid spot. |
bool StartLocalTestOnServerJoinFail { get; } | If set, startup falls back to a local test when joining a server fails. |
bool StartMenuSceneOnServerJoinFail { get; } | If set, startup falls back to the menu scene when joining a server fails. |
Color ToggleOffColor { get; } | Colour of a server selection toggle when off. |
Color ToggleOnColor { get; } | Colour of a server selection toggle when on. |
Methods
| Member | What it is |
|---|---|
async Task<bool> HandleStartupActionAsync() | Stub in this build: always returns false without doing anything. |
static async Task InstantiatePlatformManagerAsync() | Loads the addressable <platform>/Platform Manager prefab once, keeps it across scene loads, and waits if a load is already running. |
IServerAccess LocalGameServerAccess(int sceneIndex = -1) | Server access for a local loopback server, for a scene index or the active scene. Used by local test commands. |
GameServerInfo LocalGameServerInfo(int sceneIndex = -1) | Builds the server info for a local dev server: loopback address, port 1757, the given or active scene index. |