Beispiel #1
0
        public override NodeStatus Process()
        {
            NodeStatus status = CurrentSubNode.Execute();

            switch (status)
            {
            case NodeStatus.Complete:
            {
                if (Next())
                {
                    return(NodeStatus.Processing);
                }
                else
                {
                    return(NodeStatus.Complete);
                }
            }

            case NodeStatus.Processing:
            case NodeStatus.Wait:
            {
                return(NodeStatus.Processing);
            }

            case NodeStatus.Break:
            {
                return(NodeStatus.Break);
            }

            default:
            {
                return(NodeStatus.Complete);
            }
            }
        }
Beispiel #2
0
        public override NodeStatus Process()
        {
            if (m_loopCount >= LoopTimes)
            {
                return(NodeStatus.Complete);
            }

            NodeStatus status = CurrentSubNode.Execute();

            switch (status)
            {
            case NodeStatus.Complete:
            case NodeStatus.Break:
            {
                if (Next())
                {
                    return(NodeStatus.Processing);
                }
                else
                {
                    m_loopCount++;
                    ResetLoop();
                    return(NodeStatus.Processing);
                }
            }

            case NodeStatus.Processing:
            case NodeStatus.Wait:
            {
                return(NodeStatus.Processing);
            }

            default:
            {
                return(NodeStatus.Complete);
            }
            }
        }