public void StartGame() { SetPageState(PageState.Game); ScorePointScript scorepointscript = gamePage.GetComponentInChildren <ScorePointScript>(); scorepointscript.punteggio = 0; }
void OnScored() { score = PlayerPrefs.GetInt("Score"); ScorePointScript scorepointscript = gamePage.GetComponentInChildren <ScorePointScript>(); scorepointscript.punteggio = score; ScorePointScript scorepointscriptover = gameOverPage.GetComponentInChildren <ScorePointScript>(); scorepointscriptover.punteggio = score; int highscore = PlayerPrefs.GetInt("HighScore"); if (score > highscore) { PlayerPrefs.SetInt("HighScore", score); } }