1
This commit is contained in:
@@ -90,11 +90,6 @@ namespace BITKit.Entities
|
||||
OnSetAlive?.Invoke(alive);
|
||||
}
|
||||
|
||||
private void AddHP(int hp)
|
||||
{
|
||||
OnHealthPointChangedInternal(healthPoint, healthPoint += hp);
|
||||
}
|
||||
|
||||
private void OnGetDamage(DamageMessage damageMessage)
|
||||
{
|
||||
if (damageMessage.Target != UnityEntity) return;
|
||||
@@ -114,11 +109,23 @@ namespace BITKit.Entities
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Data.Get<bool>("god") is false)
|
||||
AddHP(-damage);
|
||||
|
||||
|
||||
damageMessage.Damage = damage;
|
||||
if (Data.Get<bool>("god") is false)
|
||||
{
|
||||
healthPoint-=damage;
|
||||
}
|
||||
|
||||
IsAlive = healthPoint >= 0;
|
||||
|
||||
OnSetHealthPoint?.Invoke(healthPoint);
|
||||
|
||||
OnDamageRelease?.Invoke(damageMessage);
|
||||
|
||||
if (!IsAlive)
|
||||
{
|
||||
OnSetAliveInternal(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
|
Reference in New Issue
Block a user