Added static access for score
This commit is contained in:
1 parent
802ac2e078
commit
0f54288287
1 file changed
+14
-1
@@ -18,10 +18,23 @@ namespace InterfaceOff.WorldScene
|
|||||||
[field: SerializeField] private WindowSpawner Spawner { get; set; }
|
[field: SerializeField] private WindowSpawner Spawner { get; set; }
|
||||||
|
|
||||||
private static List<PlayerScore> PlayerScores { get; } = new();
|
private static List<PlayerScore> PlayerScores { get; } = new();
|
||||||
|
private static ScoreTracker Instance { get; set; }
|
||||||
|
|
||||||
private bool StoredScore = false;
|
private bool StoredScore = false;
|
||||||
private float Score = 0f;
|
private float Score = 0f;
|
||||||
|
|
||||||
|
public static float CurrentScore()
|
||||||
|
{
|
||||||
|
if (DebugUtils.IsNull(Instance))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Instance.Score;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Awake() => Instance = this;
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (Spawner.AutoSpawn)
|
if (Spawner.AutoSpawn)
|
||||||
|
|||||||
Reference in new issue
Block a user