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