public void RecoverDamage(int damageToRecover) { _currentHp = _currentHp + damageToRecover > _maxHp ? _maxHp : _currentHp + damageToRecover; if (ShipTakeDamageEvent != null) { ShipTakeDamageEvent.Invoke((float)_currentHp / _maxHp); } }
public void Hit(int damage) { GetComponent <CameraShake>().DoShake(damage); _currentHp -= damage; if (ShipTakeDamageEvent != null) { ShipTakeDamageEvent.Invoke((float)_currentHp / _maxHp); } CheckIfDead(); }