Exemple #1
0
 public void RestoreHealth()
 {
     if (_currentHealth < 3)
     {
         _currentHealth++;
         OnHeartChanged?.Invoke(this, new OnHeartChangedEventAgrs {
             currentHealth = _currentHealth, isRestore = true
         });
     }
 }
Exemple #2
0
 public void DecreaseHealth()
 {
     if (_currentHealth > 0)
     {
         OnHeartChanged?.Invoke(this, new OnHeartChangedEventAgrs {
             currentHealth = _currentHealth, isRestore = false
         });
         _currentHealth--;
         if (_currentHealth == 0)
         {
             OnHeartEnded?.Invoke(this, EventArgs.Empty);
         }
     }
 }