Game UI ready

This commit is contained in:
Mausham
2025-12-15 17:49:08 -08:00
parent 0ea929bd20
commit f4c55dec05
325 changed files with 28015 additions and 360 deletions

View File

@@ -1,10 +1,12 @@
using System;
using UnityEngine;
public class ScoreService
public class ScoreService : IScoreService
{
public int score=0;
public int highScore=PlayerPrefs.GetInt("HighScore",0);
public event Action<int> OnScoreChange;
public int score { get; private set; }
public int highScore { get; private set; } = PlayerPrefs.GetInt("HighScore");
public void AddScore()
{
@@ -13,6 +15,7 @@ public class ScoreService
{
SetNewHighScore();
}
OnScoreChange?.Invoke(score);
}
private void SetNewHighScore()
@@ -23,3 +26,11 @@ public class ScoreService
}
}
public interface IScoreService
{
int score { get; }
int highScore { get; }
event Action<int> OnScoreChange;
void AddScore();
}