// Update is called once per frame void Update() { /*Escape Menu*/ if (Input.GetKeyDown(KeyCode.Escape)) { if (menu) { QuitF(); } if (!menu) { if (!escape) { EscapeMenuPanel.SetActive(true); escape = true; } else //escape == true { EscapeMenuPanel.SetActive(false); escape = false; } } } if (restart) { if (Input.GetKeyDown(KeyCode.R)) { restartLevel(); } } }
public void GoToMM() { escape = false; EscapeMenuPanel.SetActive(false); gameOverText.text = ""; SceneManager.LoadScene(iSceneMMBackground); MainMenuPanel.SetActive(true); }
public void restartLevel() { myLoadScene(iLevel); OceanController oceanController = GameObject.Find("OceanController").gameObject.GetComponent <OceanController>(); if (!oceanController) { throw new UnassignedReferenceException("Canoot find oceanController"); } oceanController.Restart(); EscapeMenuPanel.SetActive(false); escape = false; gameOverText.text = ""; }