VrMainMenu
A class in Root.Township, the global namespace.
Controller for the VR main menu scene (singleton Instance): starts a local test or joins a server picked from the server list. Client only.
- Listed in Global namespace: T to X
- Inherits or implements
SingletonBehaviour<VrMainMenu> - Derived types
VrMainMenu
Constructors
| Member | What it is |
|---|---|
VrMainMenu() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private LocalNetworkScene localScene | The menu's local network scene, emptied by PrepareForUnload. |
private static Logger logger | Logger for this class. |
private ServerSelectionMenu serverSelection | The server list menu, paused while a game starts. |
private Task startingGameTask | The game start in progress, used to block a second start. |
private bool startLocalTest | Inspector button for StartLocalTest. |
Methods
| Member | What it is |
|---|---|
void JoinServer(GameServerInfo serverInfo) | Joins the given game server through GameModeManager, unless a start is already running. Called by the server list. |
void PrepareForUnload() | Destroys the menu scene's local entities and clears IsLocalTest. Called by AltaSceneManager. |
void StartLocalTest() | Starts a local test game through GameModeManager.StartLocalTest, unless a start is already running. |
static async Task TakeMemorySnapShot() | Cleans memory, then saves a Unity memory profiler snapshot in the persistent data folder. |
5 private and internal methods
| Member | What it is |
|---|---|
private static void FinishedSnapshot(string arg1, bool arg2) | Logs when a memory snapshot is done. |
private static void LowMemory() | Logs a low memory warning and runs ApplicationManager.CleanMemory. |
private void OnValidate() | Editor: starts a local test when the startLocalTest button is pressed. |
private void Start() | Sets the main menu logger and marks the scene as a local test. |
private async Task StartGameAsync(Func<Task<bool>> startGameMode) | Fades to black and runs the start function. On failure fades back in, resumes the server list and goes back to local test mode. |