public void UpdateScore(int score) { _currentScore += score; PlayerPreferenceManager.SetScore(_currentScore); scoreCounter.text = _currentScore.ToString("D11"); if (_currentScore > PlayerPreferenceManager.GetHighscore()) { UpdateHighScore(score); } }
void Start() { PlayerPreferenceManager.SetScore(_currentScore); if (PlayerPreferenceManager.GetHighscore() > 0) { _highScore = PlayerPreferenceManager.GetHighscore(); } else { PlayerPreferenceManager.SetHighscore(9000); _highScore = 9000; } this.UpdateHighScore(_highScore); }