public void InitializeUIFromGameState() { // Don't need to Exit any states because this is first-time setup... ? switch (gameManager.gameState) { case GameManager.GameState.MainMenu: //do something panelMainMenu.gameObject.SetActive(true); panelOptions.gameObject.SetActive(false); panelChallengeSetup.gameObject.SetActive(false); panelTraining.gameObject.SetActive(false); panelTournament.gameObject.SetActive(false); panelMainMenu.EnterState(); break; case GameManager.GameState.OptionsMenu: //do something panelMainMenu.gameObject.SetActive(false); panelOptions.gameObject.SetActive(true); panelChallengeSetup.gameObject.SetActive(false); panelTraining.gameObject.SetActive(false); panelTournament.gameObject.SetActive(false); panelOptions.EnterState(); break; case GameManager.GameState.ChallengeSetup: //do something panelMainMenu.gameObject.SetActive(false); panelOptions.gameObject.SetActive(false); panelChallengeSetup.gameObject.SetActive(true); panelTraining.gameObject.SetActive(false); panelTournament.gameObject.SetActive(false); panelChallengeSetup.EnterState(); break; case GameManager.GameState.Training: //do something panelMainMenu.gameObject.SetActive(false); panelOptions.gameObject.SetActive(false); panelChallengeSetup.gameObject.SetActive(false); panelTraining.gameObject.SetActive(true); panelTournament.gameObject.SetActive(false); panelTraining.EnterState(); break; case GameManager.GameState.Tournament: //do something panelMainMenu.gameObject.SetActive(false); panelOptions.gameObject.SetActive(false); panelChallengeSetup.gameObject.SetActive(false); panelTraining.gameObject.SetActive(false); panelTournament.gameObject.SetActive(true); panelTournament.EnterState(); break; default: //do nothing Debug.LogError("[ERROR!] NO SUCH GAMESTATE FOUND! (" + gameManager.gameState.ToString() + ")"); break; } }