コード例 #1
0
 private void PlayerLost()
 {
     TimeSurvivedPanel.text = (Math.Round(TimeFromGameStart, 2)).ToString() + "s";
     StopAllCoroutines();
     spawnController.DisableSpawning();
     GameOverScreen.SetActive(true);
     FernPooler.DisableFerns();
 }
コード例 #2
0
 IEnumerator UpdateCorruption()
 {
     while (true)
     {
         int activeFerns = FernPooler.GetActiveFerns();
         corruptionLevel     += activeFerns * corruptionPerFern;
         filledBar.fillAmount = corruptionLevel / maxCorruption;
         if (corruptionLevel > maxCorruption)
         {
             PlayerLost();
         }
         yield return(new WaitForSeconds(1));
     }
 }