public void ExitGame() { ProfileInfo.SaveProfileInfos(); PlayerManager.ReinitializeAllPlayerManagers(); MainMenu.MainMenuSingleton().SetActive(true); MainMenu.MainMenuSingleton().OnPlayButton(); m_gameCamera.gameObject.SetActive(false); m_menuCamera.gameObject.SetActive(true); m_ingameMenu.gameObject.SetActive(false); m_gameUI.gameObject.SetActive(false); if (m_isSolo) { m_soloManager.RemoveTokens(); } else { RoundManager.Singleton().RemoveTokens(); } m_isSolo = false; m_isMulti = false; PlayIntroMusic(); StopCoroutine(GameLoop()); MainNetworkManager.Singleton().StopHost(); MainNetworkManager.Singleton().StopClient(); }
public void OnBack(string currentMenu) { switch (currentMenu) { case "Play": SetCurrentMenu(m_startMenu); break; case "Lobby": if (SetCurrentMenu(m_playMenu)) { MainNetworkManager.Singleton().StopHost(); MainNetworkManager.Singleton().StopClient(); m_lobbyMenu.GetComponent <LobbyMenu>().ExitLobby(); PlayerManager.ReinitializeAllPlayerManagers(); } break; case "Profile": SetCurrentMenu(m_playMenu); break; case "NewProfile": case "ModifyProfile": case "Stats": SetCurrentMenu(m_profileMenu); break; } }
public void OnSoloGame() { if (!ProfileInfo.ProfileInfosLoaded()) { SetCurrentMenu(m_newProfileMenu); return; } if (SetCurrentMenu(m_soloMenu)) { MainNetworkManager.Singleton().StopHost(); MainNetworkManager.Singleton().StopClient(); MainNetworkManager.Singleton().StartHost(); GameManager.Singleton().StartSoloGame(); } }
public void StartGame() { List <PlayerManager> allPlayerManagers = PlayerManager.AllPlayerManagers(); foreach (PlayerManager playerManager in allPlayerManagers) { playerManager.InitializeIngame(); } MainMenu.MainMenuSingleton().gameObject.SetActive(false); m_menuCamera.gameObject.SetActive(false); m_gameCamera.gameObject.SetActive(true); m_ingameMenu.gameObject.SetActive(true); m_isMulti = true; PlayIngameMusic(); MainNetworkManager.Singleton().StopDiscovery(); RoundManager.Singleton().ResetRoundManager(); StartCoroutine(GameLoop()); }