This commit is contained in:
CortexCore
2023-11-06 01:17:23 +08:00
parent bd40165ade
commit 5446067f91
114 changed files with 2023 additions and 414 deletions

View File

@@ -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()