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