33 lines
924 B
C#
33 lines
924 B
C#
using BehaviorDesigner.Runtime.Tasks;
|
|
using Gameplay.BT.Variables;
|
|
using Gameplay.Level;
|
|
using Gameplay.Unit;
|
|
using Framework;
|
|
|
|
namespace Code.Scripts.Gameplay.BT.Conditional
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class BTChainTrigger : 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 (_owner != null && SharedBattleInfo.Value.AttachAIName == LevelData.AttachAIType.ChainAI &&
|
|
SharedBattleInfo.Value.theChosenOneId != Constants.INVALID_UINT_ID)
|
|
{
|
|
return TaskStatus.Success;
|
|
}
|
|
|
|
return TaskStatus.Failure;
|
|
}
|
|
}
|
|
} |