Example #1
0
        public void onDamaged(DamageEventArgs args)
        {
            DamageEventHandler handler = DamageEvent;

            if (handler != null)
            {
                handler(this, args);
            }

            if (DamageSound != null)
            {
                DamageSound.Play();
            }
            ActiveAnimation = DamageAnimation;
        }
Example #2
0
 public void TakeDamage(int damage)
 {
     Health -= damage;
     DamageSound.Play();
 }