void AddLife(float heal) { if (_invulnerable) { return; } Hp += heal; LightsModule.SetLifeValue(Hp / maxHP); }
void SubstractLife(float damage, Vector3 hitPosition) { if (_invulnerable) { return; } if (_vibrationAvailable) { ApplyVibration(0, 2, 0.2f); _vibrationAvailable = false; StartCoroutine(VibrationCooldown()); } Hp -= damage; LightsModule.SetLifeValue(Hp / maxHP); _lifeForcefield.TakeDamage(hitPosition); }
public void ResetHP() { Hp = maxHP; LightsModule.SetLifeValue(Hp / maxHP); }