void Update() { if (playerStats.stats.networth <= 0 || countDownTime <= 0) { bool lose = playerStats.stats.networth <= 0; string gameovertext = lose ? loseText : winText; gui.SetGameOver(gameovertext); GameObject player = GameObject.FindGameObjectsWithTag("Player")[0]; player.GetComponent <Animator>().Play("disappear"); } else { gui.SetTimer(string.Format("{0:0.} Sec.", countDownTime)); } countDownTime -= Time.deltaTime; }