コード例 #1
0
    void ChangeActiveMenu(int whichMenu)
    {
        switch (whichMenu)
        {
        case MenuID.START_MENU:
            _startMenu.ChangeState(true);
            _statsMenu.ChangeState(false);
            _pauseMenu.ChangeState(false);
            _optionsMenu.ChangeState(false);
            _creditMenu.ChangeState(false);
            backGroundPlane.gameObject.SetActive(true);
            GetButtonList();
            break;

        case MenuID.PAUSE_MENU:
            _startMenu.ChangeState(false);
            _statsMenu.ChangeState(false);
            _pauseMenu.ChangeState(true);
            _optionsMenu.ChangeState(false);
            _creditMenu.ChangeState(false);
            backGroundPlane.gameObject.SetActive(true);
            GetButtonList();
            break;

        case MenuID.STATS_MENU:
            _startMenu.ChangeState(false);
            _statsMenu.ChangeState(true);
            _pauseMenu.ChangeState(false);
            _optionsMenu.ChangeState(false);
            _creditMenu.ChangeState(false);
            backGroundPlane.gameObject.SetActive(true);
            GetButtonList();
            break;

        case MenuID.OPTIONS_MENU:
            _startMenu.ChangeState(false);
            _statsMenu.ChangeState(false);
            _pauseMenu.ChangeState(false);
            _optionsMenu.ChangeState(true);
            _creditMenu.ChangeState(false);
            backGroundPlane.gameObject.SetActive(true);
            GetButtonList();
            break;

        case MenuID.CREDIT_MENU:
            _startMenu.ChangeState(false);
            _statsMenu.ChangeState(false);
            _pauseMenu.ChangeState(false);
            _optionsMenu.ChangeState(false);
            _creditMenu.ChangeState(true);
            backGroundPlane.gameObject.SetActive(true);
            GetButtonList();
            break;

        case MenuID.OFF_MENU:
            _startMenu.ChangeState(false);
            _statsMenu.ChangeState(false);
            _pauseMenu.ChangeState(false);
            _optionsMenu.ChangeState(false);
            _creditMenu.ChangeState(false);
            backGroundPlane.gameObject.SetActive(false);
            break;
        }
    }