using UnityEngine; public class ScoreService { public int score=0; public int highScore=0; public void AddScore() { score += 5; if (score>highScore) { SetNewHighScore(); } } private void SetNewHighScore() { highScore = score; PlayerPrefs.SetInt("HighScore", highScore); } }