示例#1
0
 // if the user selects the retry button
 public void Retry()
 {
     // Resetting values
     Time.timeScale = 1f;
     popup.SetActive(false);
     pauseButton.SetActive(true);
     // loading level
     loadLevel.ChangeLevel();
     GameManager.Instance.ResetValues();
 }
    // function to load up next level
    public void NextLevel()
    {
        GameManager.Instance.CurrLevel += 1;

        int score = PlayerPrefs.GetInt("score1");

        if (GameManager.Instance.Collected > score)
        {
            PlayerPrefs.SetInt("score1", GameManager.Instance.Collected);
        }

        PlayerPrefs.SetInt("level", GameManager.Instance.CurrLevel);

        loadLevel.ChangeLevel();
    }