1
This commit is contained in:
@@ -6,7 +6,7 @@ using UnityEngine;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
public class AutoHealComponent : EntityComponent,IDamageCallback
|
||||
public class AutoHealBehavior : EntityBehavior,IDamageCallback
|
||||
{
|
||||
[SerializeField] private IntervalUpdate healDelayInterval;
|
||||
[SerializeField] private IntervalUpdate healInterval;
|
||||
@@ -14,17 +14,12 @@ namespace BITKit
|
||||
private readonly ValidHandle allowHeal = new();
|
||||
[Inject]
|
||||
private IHealth _health;
|
||||
public override void Initialize(IEntity _entity)
|
||||
{
|
||||
base.Initialize(_entity);
|
||||
_health.OnSetAlive += OnSetAlive;
|
||||
_health.OnSetHealthPoint += OnSetHP;
|
||||
_entity.RegisterCallback<IDamageCallback>(this);
|
||||
}
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
_health = entity.Get<IHealth>();
|
||||
_health = UnityEntity.Get<IHealth>();
|
||||
|
||||
_health.OnSetAlive += OnSetAlive;
|
||||
_health.OnSetHealthPoint += OnSetHP;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
Reference in New Issue
Block a user