mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
28 lines
586 B
C#
28 lines
586 B
C#
using BehaviorDesigner.Runtime;
|
|
using BehaviorDesigner.Runtime.Tasks;
|
|
|
|
namespace MoleMole
|
|
{
|
|
[TaskCategory("Monster")]
|
|
public class GetMonsterHP : Action
|
|
{
|
|
public SharedFloat HPRatio;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
}
|
|
|
|
public override void OnStart()
|
|
{
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
BaseMonoMonster component = GetComponent<BaseMonoMonster>();
|
|
MonsterActor actor = Singleton<EventManager>.Instance.GetActor<MonsterActor>(component.GetRuntimeID());
|
|
HPRatio.SetValue((float)actor.HP / (float)actor.maxHP);
|
|
return TaskStatus.Success;
|
|
}
|
|
}
|
|
}
|