Ejemplo n.º 1
0
        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);
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }