コード例 #1
0
 private void OnDamageTaken(DamageEventArgs args)
 {
     if (DamageTaken != null)
     {
         DamageTaken(args);
     }
 }
コード例 #2
0
        public void TakeDamage(Damage damage)
        {
            ModifyHealth(-damage.Value);
            var args = new DamageEventArgs(Self, damage);

            OnDamageTaken(args);
            //TODO, replace with a kill callback in TakeDamage
            if (HealthPercentage <= 0f)
            {
                Die(damage.Source);
            }
        }