32 lines
909 B
C#
32 lines
909 B
C#
using BehaviorDesigner.Runtime.Tasks;
|
|
using Framework;
|
|
using Gameplay.BT.Variables;
|
|
using Gameplay.Unit;
|
|
|
|
namespace Code.Scripts.Gameplay.AI.Conditional
|
|
{
|
|
/// <summary>
|
|
/// 检测是否被激活
|
|
/// </summary>
|
|
public class BTCheckAIGroup : BehaviorDesigner.Runtime.Tasks.Conditional
|
|
{
|
|
public SharedBattleInfo SharedBattleInfo;
|
|
private GameUnit _owner;
|
|
|
|
public override void OnStart()
|
|
{
|
|
_owner = GameUnitManager.instance.infightUnits.Search(SharedBattleInfo.Value.ownerId);
|
|
}
|
|
|
|
public override TaskStatus OnUpdate()
|
|
{
|
|
if (SharedBattleInfo.Value.groupInfo.Count > 0 &&
|
|
SharedBattleInfo.Value.theChosenOneId != Constants.INVALID_UINT_ID)
|
|
{
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
return TaskStatus.Failure;
|
|
}
|
|
}
|
|
} |