// Use this for initialization void OnLevelWasLoaded() { ReadyCount = 0; isWaitingForNextStage = PlayersHaveReachedEnd = false; lastFrameTime = thisFrameTime = (int)Time.time; delta = 0; isBuilderAtEnd = false; isMoverAtEnd = false; isJumperAtEnd = false; isViewerAtEnd = false; finalAnalyticsSent = false; // statusText = "Press [Spacebar] to Go To Next Stage"; //Now I'll handle it here. GameManagerVik.setNextLevel(Application.loadedLevel); currGameManager = GameObject.Find("Code").GetComponent <GameManagerVik>(); if (currGameManager.level_tester_mode) { TargetReadyCount = 1; } else { TargetReadyCount = 4; } timeLeft = levelTimeInMinutes * 60; //Initialise hashtable for each level ending scores LevelCompleteGUI.showWindow = false; clearLevelScore["Clear Time"] = 0; clearLevelScore["Total Deaths"] = 0; }
void drawLobbyWindow(int windowID) { // use the spike function to add the spikes AddSpikes(lobbyWindowRect.width); //Player name GUILayout.BeginHorizontal(); // GUILayout.Space(Screen.width * 0.1f); GUILayout.Label("Welcome back, " + PhotonNetwork.playerName, GUILayout.Height(Screen.height * 0.1f)); GUILayout.EndHorizontal(); //Player's latest stage // GUILayout.Space(Screen.width * 0.1f); GUILayout.Label("Max level reached: " + GameManagerVik.maxStageReached, "ShortLabel"); //GUILayout.Space(Screen.width * 0.1f); GUILayout.BeginHorizontal(); GUILayout.Label("Select a level"); if (GUILayout.Button("<<")) { MainMenuVik.levelSelected--; if (MainMenuVik.levelSelected < 1) { MainMenuVik.levelSelected = 1; } } GUILayout.Label("Level " + MainMenuVik.levelSelected.ToString(), "LegendaryText"); if (GUILayout.Button(">>")) { MainMenuVik.levelSelected++; if (MainMenuVik.levelSelected > GameManagerVik.maxStageReached) { MainMenuVik.levelSelected = GameManagerVik.maxStageReached; } } GUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.Label("", "Divider"); GameManagerVik.setNextLevel(MainMenuVik.levelSelected); //Rooms list GUILayout.Label("ROOMS LIST", GUILayout.Height(Screen.height * 0.1f)); GUILayout.BeginScrollView(Vector2.zero); string[] roomNames = updateAllRoomsNames(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); for (int x = 0; x < 10; x++) { if (GUILayout.Button(roomNames[x] + allRoomsCapacity[x], GUILayout.Width(Screen.width * 0.2f))) { attemptEnterRoom(roomNames[x]); } } GUILayout.EndVertical(); GUILayout.BeginVertical(); for (int x = 10; x < 20; x++) { if (GUILayout.Button(roomNames[x] + allRoomsCapacity[x], GUILayout.Width(Screen.width * 0.2f))) { attemptEnterRoom(roomNames[x]); } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndScrollView(); GUILayout.Space(5); GUILayout.BeginHorizontal(); if (GUILayout.Button("Log out")) { Debug.Log("LOG OUT"); MainMenuVik.currentMenuState = menuState.login; } if (GUILayout.Button("Quit to windows")) { Debug.Log("QUIT TO WINDOWS"); Application.Quit(); } GUILayout.EndHorizontal(); GUI.DragWindow(new Rect(0, 0, 10000, 10000)); }