Exemple #1
0
// 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();
            }
        }
    }
Exemple #2
0
 public void GoToMM()
 {
     escape = false;
     EscapeMenuPanel.SetActive(false);
     gameOverText.text = "";
     SceneManager.LoadScene(iSceneMMBackground);
     MainMenuPanel.SetActive(true);
 }
Exemple #3
0
    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 = "";
    }