Exemplo n.º 1
0
        public override NodeState Activate(NodeStateHandle state)
        {
            for (int i = 0; i < state.ChildCount; ++i)
            {
                state.ActivateChild(i);
            }

            return(NodeState.Running);
        }
Exemplo n.º 2
0
        public override NodeState Update(float dt, NodeStateHandle h)
        {
            for (int i = 0; i < h.ChildCount; ++i)
            {
                if (!h.ChildState(i).Active())
                {
                    h.ActivateChild(i);
                }
            }

            return(NodeState.Running);
        }
Exemplo n.º 3
0
        public override NodeState Update(float dt, NodeStateHandle state, ref int value)
        {
            var curChildState = state.ChildState(value);

            if (curChildState.Active())
            {
                return(NodeState.Running);
            }
            ++value;
            if (value < state.ChildCount)
            {
                state.ActivateChild(value);
                return(NodeState.Running);
            }
            else
            {
                return(NodeState.Complete);
            }
        }
Exemplo n.º 4
0
 public override NodeState Activate(NodeStateHandle state, ref int value)
 {
     value = 0;
     state.ActivateChild(0);
     return(NodeState.Running);
 }