public void EndGame() { if (!gameHasEnded) { bool gameHasEnded = true; int currentScore = (int)FindObjectOfType <Score>().score; if (PlayerPrefs.GetInt("HighScore") < currentScore) { PlayerPrefs.SetInt("HighScore", currentScore); newHighScore = true; } gameOverScreen.startGameOverAnimation(currentScore, newHighScore); PlayGamesController.PostToLeaderBoard((long)PlayerPrefs.GetInt("HighScore")); } }
void Start() { PlayGamesController.PostToLeaderBoard((long)PlayerPrefs.GetInt("HighScore")); }