IEnumerator ShowFailPopup(float time, Collider2D collision) { yield return(new WaitForSeconds(time)); gameController.Stop(); MusicPlayer.getInstance().handleFailSound(); textProgress.ShowFailPopup(); //StartCoroutine (BackToStartScene (5)); }
private void CompleteLevel() { gameController.Stop(); HideComponent(); StartCoroutine(ShowCompletePopup(0.1f, passingStage)); int currentStage = PlayerPrefHelper.GetCurrentStage(); passingStage = passingStage + 1; PlayerPrefHelper.SavePassingStage(passingStage); if (passingStage > currentStage) { PlayerPrefHelper.SaveCurrentStage(passingStage); } //SceneManager.LoadScene(SceneManager.GetActiveScene().name); }