コード例 #1
0
 public override ResultType Execute(BInput _input)
 {
     this.state = State.Running;
     for (int i = 0; i < listChilds.Count; i++)
     {
         Node _node = listChilds[i];
         _node.RunNode(_input);
     }
     state = State.Exit;
     return(ResultType.Success);
 }
コード例 #2
0
        public override ResultType Execute(BInput _input)
        {
            state = State.Running;
            if (_currentIndex > listChilds.Count)
            {
                return(ResultType.Fail);
            }
            Node _node = listChilds[_currentIndex];

            this._input = _input;
            return(_node.RunNode(_input));
        }
コード例 #3
0
        public override ResultType Execute(BInput _input)
        {
            if (_currentIndex >= listChilds.Count)
            {
                GameInput.DebugLog("没有找到匹配这个条件的");
                return(ResultType.Fail);
            }

            Node _node = listChilds[_currentIndex];

            if (_node.Evaluate(_input))
            {
                return(result = _node.RunNode(_input));
            }
            else
            {
                _currentIndex++;
                Execute(_input);
            }
            result = ResultType.Running;
            return(result);
        }