IEnumerator WaitForLastObstacle() { while (FindObjectOfType <Obstacle>() != null) { yield return(new WaitForSeconds(1f)); } State = GameState.PAUSE; _scorePanel.ShowPanel(); }