public void onDamaged(DamageEventArgs args) { DamageEventHandler handler = DamageEvent; if (handler != null) { handler(this, args); } if (DamageSound != null) { DamageSound.Play(); } ActiveAnimation = DamageAnimation; }
public void TakeDamage(int damage) { Health -= damage; DamageSound.Play(); }