public void CloseMenu() { if (lastActivePanel != null) { lastActivePanel.gameObject.SetActive(false); lastActivePanel = null; } }
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); } }
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); } }