public static NodeState Tick(int index, INodeBlob blob, IBlackboard blackboard) { var childState = blob.TickChildren(index, blackboard).FirstOrDefault(); if (childState == 0) { blob.ResetChildren(index, blackboard); childState = blob.TickChildren(index, blackboard).FirstOrDefault(); } ref var data = ref blob.GetNodeData <RepeatTimesNode>(index);
public NodeState Tick(int index, INodeBlob blob, IBlackboard blackboard) { var childState = blob.TickChildren(index, blackboard).FirstOrDefault(); if (childState == 0) { blob.ResetChildren(index, blackboard); childState = blob.TickChildren(index, blackboard).FirstOrDefault(); } return(BreakStates.HasFlagFast(childState) ? childState : NodeState.Running); }
public NodeState Tick(int index, INodeBlob blob, IBlackboard blackboard) { var childState = blob.TickChildren(index, blackboard).FirstOrDefault(); if (childState == 0) { blob.ResetChildren(index, blackboard); childState = blob.TickChildren(index, blackboard).FirstOrDefault(); } if (BreakStates.HasFlag(childState)) { return(childState); } TickTimes--; return(TickTimes <= 0 ? NodeState.Success : NodeState.Running); }
public NodeState Tick(int index, INodeBlob blob, IBlackboard bb) { var childState = blob.TickChildren(index, bb).FirstOrDefault(); if (childState == 0) { blob.ResetChildren(index, bb); childState = blob.TickChildren(index, bb).FirstOrDefault(); } if (BreakStates.HasFlag(childState)) { return(childState); } CountdownSeconds -= bb.GetData <BehaviorTreeTickDeltaTime>().Value; return(CountdownSeconds <= 0 ? NodeState.Success : NodeState.Running); }