void Update() { // Set the score text. GetComponent <Text>().text = "Score: " + score; // If the score has changed... if (previousScore != score) { // ... play a taunt. playerControl.StartCoroutine(playerControl.Taunt()); if (this.score > this.highScore) { this.highScore = score; StatsService.ChangeHighScore(SceneManager.GetActiveScene().name, score); } } // Set the previous score to this frame's score. previousScore = score; }