Exemple #1
0
    /// <summary>
    /// Restart this Scene
    /// </summary>
    public IEnumerator Restart()
    {
        bool isPressed = false;

        while (!isPressed)
        {
            isPressed = Input.GetMouseButtonDown(0) || Input.GetButtonDown("Jump");
            yield return(null);
        }
        yield return(StartCoroutine(UIManager.Instance.GameOverAnimationEnd()));

        State     = PlayState.Gaming;
        BestScore = DataSaver.LoadBestScore();
        SceneManager.LoadScene(0); // Now Scene
    }
Exemple #2
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     BestScore           = DataSaver.LoadBestScore();
     Screen.sleepTimeout = SleepTimeout.NeverSleep;
     Screen.SetResolution(414, 732, true);
 }