public void AddScore(int scoreToAdd) { // Is the game over? if (isGameOver) { return; // Exit the function } // Add score score += scoreToAdd; // Call subscribers scoreAdded.Invoke(score); }
public void AddScore(int scoreToAdd) { //if the game is over /Is the game over? if (isGameOver) { return; } //add score score += scoreToAdd; //call subscribers scoreAdded.Invoke(score); }
public void Init() { if (Value.GetType() == typeof(string)) { StringCallback?.Invoke(GetString()); } else if (Value.GetType() == typeof(bool)) { BoolCallback?.Invoke((bool)Value); } else if (Value.GetType() == typeof(int)) { IntCallback?.Invoke((int)Value); } else if (Value.GetType() == typeof(float)) { FloatCallback?.Invoke((float)Value); } }
public void Set(int value) { SetValue(value); IntCallback?.Invoke(value); Save(); }