예제 #1
0
    public bool IsActivePanel(MenuPanelType _type)
    {
        if (lastActivePanel != null)
        {
            return(lastActivePanel.menuType == _type);
        }

        return(false);
    }
    public void ChangePanel(MenuPanelType panel)
    {
        // Close all panels.
        mainMenuPanel.SetActive(false);
        splashscreenPanel.SetActive(false);

        // Open correct panel.
        switch (panel)
        {
        default:
        case MenuPanelType.MainMenu:
            mainMenuPanel.SetActive(true);
            break;

        case MenuPanelType.Splashscreen:
            splashscreenPanel.SetActive(true);
            break;
        }
    }
예제 #3
0
    public void SwitchMenuPanel(MenuPanelType _type)
    {
        if (lastActivePanel != null)
        {
            lastActivePanel.gameObject.SetActive(false);
        }

        if (_type == MenuPanelType.EndGameLooseMenu || _type == MenuPanelType.EndGameWinMenu || _type == MenuPanelType.MainMenu)
        {
            Time.timeScale = 0;
        }

        MenuPanelController desiredPanel = menuPanelControllerList.Find(x => x.menuType == _type);

        if (desiredPanel != null)
        {
            desiredPanel.gameObject.SetActive(true);
            lastActivePanel = desiredPanel;
        }
        else
        {
            Debug.LogWarning("The desired panel was not found!" + _type);
        }
    }