Ejemplo n.º 1
0
        public void AddScore(int scoreToAdd)
        {
            // Is the game over?
            if (isGameOver)
            {
                return; // Exit the function
            }
            // Add score
            score += scoreToAdd;

            // Call subscribers
            scoreAdded.Invoke(score);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 public void Set(int value)
 {
     SetValue(value);
     IntCallback?.Invoke(value);
     Save();
 }