lucid-super-dream/Assets/Scripts/Score.cs

26 lines
447 B
C#
Raw Normal View History

using System;
public static class Score
{
private static ulong _value;
2021-01-11 11:01:41 +01:00
public static ulong Value => _value;
public static void Add(ulong val)
{
_value += val;
ScoreChanged();
}
public static void Reset()
{
2021-01-11 11:01:41 +01:00
_value = 0;
ScoreChanged();
}
2021-01-11 11:01:41 +01:00
private static void ScoreChanged()
{
ScoreUpdated?.Invoke(_value);
}
public static event Action<ulong> ScoreUpdated;
}