Пример #1
0
    void LoadNextSceneInArea()
    {
        SaveLevelData();
        string str = SceneManager.GetActiveScene().name.Split('_')[2];

        int    l         = int.Parse(str);
        string sceneName = areaName + "_lvl_" + (l + 1);

        if ((l + 1) > (int)area)
        {
            //areaName finished
            EndText.text = "Finished Area";

            StartCoroutine(Wait(2f, () =>
            {
                EndText.text = "";
                SceneManager.LoadScene("AreasMenu");
            }));
        }

        try
        {
            SceneManager.LoadScene(sceneName);
        }
        catch (Exception)
        {
            MenuControl.LoadScene("Menu");
        }
    }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (red1.bounds.min.y <= red2.bounds.max.y)
     {
         Debug.Log("Kill me now!");
         mc.LoadScene("LoseGame");
     }
 }
Пример #3
0
 public void RetryLevel()
 {
     MenuControl.LoadScene(level);
 }
Пример #4
0
 public void RetryArea()
 {
     MenuControl.LoadScene(areaName + "_lvl_1");
 }