public void TakeDamage(int dmg) { if (bCanTakeDamage) { StartCoroutine(InvulnWait()); hitsRemain--; Ev_UpdateHpBar?.Invoke((float)hitsRemain / maxHitHealth); if (hitsRemain == 0) { Die(); } } }
public void TakeDamage(int amount) { if (amount <= 0) { throw new ArgumentOutOfRangeException("Invalid Damage amount specified: " + amount); } currentHp -= amount; Ev_UpdateHpBar?.Invoke((float)currentHp / startingHp); if (currentHp <= 0) { Die(); } }
internal void UpdateHpBar() { Ev_UpdateHpBar?.Invoke((float)currentHp / maxHp); }