Exemplo n.º 1
0
    //========================================Main switch case for canvas changing
    public void SwitchMenu(MenuInfo.MenuStates toState)
    {
        //only runs if they are allowed to naviate the menus
        if (canNavigate)
        {
            switch (toState)
            {
            case MenuInfo.MenuStates.Main:
                //0
                ExclusiveEnabled(mainCanvases, 0);
                GameManager.instance.MainMenuOpen();
                break;

            case MenuInfo.MenuStates.Profiles:
                //1
                ExclusiveEnabled(mainCanvases, 1);
                ProfileManager.instance.OnProfilesEnter();

                break;

            case MenuInfo.MenuStates.Records:
                //2
                ExclusiveEnabled(mainCanvases, 2);

                break;

            case MenuInfo.MenuStates.Session:
                //3
                ExclusiveEnabled(mainCanvases, 3);
                SessionManager.instance.OnSessionButtonHit();

                break;
            }
            c_MenuState = toState;
            UnityEngine.EventSystems.EventSystem.current.SetSelectedGameObject(defaultButtons[(int)toState]);
        }
    }
Exemplo n.º 2
0
    //========================================Main switch case for canvas changing
    public void SwitchMenu(MenuInfo.MenuStates toState)
    {
        //only runs if they are allowed to naviate the menus
        if (canNavigate) {
            switch (toState) {
            case MenuInfo.MenuStates.Main:
            //0
                ExclusiveEnabled (mainCanvases, 0);
                GameManager.instance.MainMenuOpen ();
                break;

            case MenuInfo.MenuStates.Profiles:
            //1
                ExclusiveEnabled (mainCanvases, 1);
                ProfileManager.instance.OnProfilesEnter ();

                break;

            case MenuInfo.MenuStates.Records:
            //2
                ExclusiveEnabled (mainCanvases, 2);

                break;

            case MenuInfo.MenuStates.Session:
            //3
                ExclusiveEnabled (mainCanvases, 3);
                SessionManager.instance.OnSessionButtonHit();

                break;

            }
            c_MenuState = toState;
            UnityEngine.EventSystems.EventSystem.current.SetSelectedGameObject(defaultButtons[(int)toState]);
        }
    }