public void ShowEndGame_WIN_Panel() { currentPanel = CurrentMenuPanel.END_GAME_WIN; //EventSystemRef.GetComponent<EventSystem>().SetSelectedGameObject(resumeButton); UpdateButtonCount(currentPanel); //Debug.Log(transform.GetChild(0).name); transform.GetChild(0).gameObject.SetActive(true); Highlighter.SetActive(true); }
public void ShowMainMenuPanel() { currentPanel = CurrentMenuPanel.MAIN_MENU; //EventSystemRef.GetComponent<EventSystem>().SetSelectedGameObject(startButton); UpdateButtonCount(currentPanel); Debug.Log(transform.GetChild(0).name); transform.GetChild(0).gameObject.SetActive(true); Highlighter.SetActive(true); }
public void ShowOptionsPanel() { currentPanel = CurrentMenuPanel.OPTIONS_MENU; //EventSystemRef.GetComponent<EventSystem>().SetSelectedGameObject(backButton); UpdateButtonCount(currentPanel); //Debug.Log(transform.GetChild(0).name); transform.GetChild(0).gameObject.SetActive(true); Highlighter.SetActive(true); }
/// <summary> /// Clears all panels and resets the count of buttons /// </summary> /// <param name="a_currentPanel"></param> private void UpdateButtonCount(CurrentMenuPanel a_currentPanel) { ClearPanels(); Button[] buttonCountInChildren = GetComponentsInChildren <Button>(); switch (currentPanel) { case CurrentMenuPanel.NONE: { //Reset them to zero currentButtonCount_MIN = 0; currentButtonCount_MAX = 0; break; } case CurrentMenuPanel.MAIN_MENU: { mainMenu_Panel.SetActive(true); //Update the current range for the main menu button count currentButtonCount_MIN = 0; currentButtonCount_MAX = buttonCountInChildren.Length; break; } case CurrentMenuPanel.OPTIONS_MENU: { optionsMenu_Panel.SetActive(true); //Update the current range for the options menu button count currentButtonCount_MIN = 0; currentButtonCount_MAX = buttonCountInChildren.Length; break; } case CurrentMenuPanel.PAUSE_MENU: { pauseMenu_Panel.SetActive(true); //Update the current range for the pause menu button count currentButtonCount_MIN = 0; currentButtonCount_MAX = buttonCountInChildren.Length; break; } case CurrentMenuPanel.END_GAME_LOSS: { endGame_LOSS_Panel.SetActive(true); //Update the current range for the pause menu button count currentButtonCount_MIN = 0; currentButtonCount_MAX = buttonCountInChildren.Length; break; } case CurrentMenuPanel.END_GAME_WIN: { endGame_WIN_Panel.SetActive(true); //Update the current range for the pause menu button count currentButtonCount_MIN = 0; currentButtonCount_MAX = buttonCountInChildren.Length; break; } default: { //??NANI!!! break; } } }