1
This commit is contained in:
@@ -26,7 +26,7 @@ namespace BITKit.Entities
|
||||
bool IsAlive { get; }
|
||||
}
|
||||
[CustomType(typeof(IHealth))]
|
||||
public class EntityHealth : EntityComponent, IHealth
|
||||
public class EntityHealth : EntityBehavior, IHealth
|
||||
{
|
||||
[Header(Constant.Header.Settings)]
|
||||
[SerializeField] private int healthPoint = 100;
|
||||
@@ -49,7 +49,7 @@ namespace BITKit.Entities
|
||||
public bool IsAlive { get; private set; }
|
||||
public override void OnAwake()
|
||||
{
|
||||
entity.AddListener<DamageMessage>(OnGetDamage);
|
||||
UnityEntity.AddListener<DamageMessage>(OnGetDamage);
|
||||
}
|
||||
|
||||
public override void OnStart()
|
||||
@@ -83,7 +83,7 @@ namespace BITKit.Entities
|
||||
|
||||
private void OnGetDamage(DamageMessage damageMessage)
|
||||
{
|
||||
if (damageMessage.Target != entity) return;
|
||||
if (damageMessage.Target != UnityEntity) return;
|
||||
if (IsAlive is false) return;
|
||||
var damage = damageMessage.Damage;
|
||||
foreach (var x in OnDamageFactory.CastAsFunc().Reverse())
|
||||
|
Reference in New Issue
Block a user