mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
31 lines
622 B
C#
31 lines
622 B
C#
using BehaviorDesigner.Runtime.Tasks;
|
|
|
|
namespace MoleMole
|
|
{
|
|
[TaskCategory("Group")]
|
|
public class GetSharedEntityAttackTarget : Action
|
|
{
|
|
public SharedEntity targetEntity;
|
|
|
|
public override void OnAwake()
|
|
{
|
|
base.OnAwake();
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
BaseMonoEntity baseMonoEntity = null;
|
|
if (targetEntity.Value != null)
|
|
{
|
|
baseMonoEntity = (targetEntity.Value as BaseMonoMonster).AttackTarget;
|
|
}
|
|
if (baseMonoEntity != null)
|
|
{
|
|
GetComponent<BaseMonoMonster>().SetAttackTarget(baseMonoEntity);
|
|
return TaskStatus.Success;
|
|
}
|
|
return TaskStatus.Failure;
|
|
}
|
|
}
|
|
}
|