コード例 #1
0
 public void CloseMenu()
 {
     if (lastActivePanel != null)
     {
         lastActivePanel.gameObject.SetActive(false);
         lastActivePanel = null;
     }
 }
コード例 #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         Manager.manager.menuPanelController.SetActive(true);
         MenuPanelController menuPanelController = Manager.manager.menuPanelController.GetComponent <MenuPanelController>();
         menuPanelController.resumeMenuActiveRespawn();
         Manager.manager.setBestScore();
         Time.timeScale = 0;
         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
     }
 }
コード例 #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);
        }
    }