// Use this for initialization void Awake() { if (instance == null) { instance = this; } else { if (this != instance) { Destroy(gameObject); } } }
IEnumerator GameOver() { NewBallManager.GetInstance().FreezeBalls(); yield return(StartCoroutine(Explode())); NewBallManager.GetInstance().KillAllBalls(); EventManager.TriggerEvent("CleanUp"); yield return(StartCoroutine(CountdownScore())); yield return(StartCoroutine(InterstitalAd())); yield return(StartCoroutine(Implode())); ScoreMaskEffect.GetInstance().Reset(); NewGameManager.GetInstance().ResetGame(); }
IEnumerator CountdownScore() { yield return(StartCoroutine(ScoreMaskEffect.GetInstance().PrepEffect(target))); yield return(StartCoroutine(NewScoreManager.GetInstance().HighscoreProcess())); float shortDelay = countdownDuration / NewScoreManager._catchCount; while (NewScoreManager._catchCount > 0) { NewScoreManager._catchCount--; yield return(new WaitForSeconds(shortDelay)); } yield return(new WaitForSeconds(.15f)); float longDelay = countdownDuration / NewScoreManager._numBalls; while (NewScoreManager._numBalls > 0) { NewScoreManager._numBalls--; yield return(new WaitForSeconds(longDelay)); } }