public IEnumerator ComputeCoins(int totalCoin, int ScoreCoin) { int TotalCoin = totalCoin; int CurrentCoin = ScoreCoin; for (int i = CurrentCoin; i > 0; i--) { yield return(new WaitForSeconds(Time.deltaTime)); TotalCoin += 1; CurrentCoin -= 1; UI.SetTotalScoreCount(TotalCoin); UI.SetGameScoreCount(CurrentCoin); //PlayCoinSound } yield return(new WaitForSeconds(CoolDownAfterCount)); EnableMainMenu(); }