Esempio n. 1
0
        protected override BTState BTUpdate()
        {
            while (true)
            {
                if (_curTask == null)
                {
                    return(AllFinishState);
                }
                var state = _curTask.__BTUpdate();
                if (state == BTState.Running)
                {
                    return(BTState.Running);
                }
                if (state == OneFinishState)
                {
                    for (var i = _curTask.Index + 1; i < ChildTasks.Length; i++)
                    {
                        ChildTasks[i].State = BTState.ForceEnd;
                    }
                    return(OneFinishState);
                }

                _curTask = _curTask.NextBt;
                _curTask?.__BTStart();
            }
        }
Esempio n. 2
0
 protected override BTState BTUpdate()
 {
     if (!_exeChildTask)
     {
         return(BTState.Failure);
     }
     return(_exeChildTask.__BTUpdate());
 }
Esempio n. 3
0
 private BTState ExecuteChildUpdate()
 {
     if (!_exeChildTask)
     {
         return(BTState.Failure);
     }
     return(_exeChildTask.__BTUpdate());
 }
Esempio n. 4
0
        protected override BTState BTUpdate()
        {
            while (true)
            {
                if (_curTask == null)
                {
                    return(ResultState);
                }

                var state = _curTask.__BTUpdate();
                if (state == BTState.Running)
                {
                    return(BTState.Running);
                }
                _curTask = _curTask.NextBt;
                _curTask?.__BTStart();
            }
        }
Esempio n. 5
0
 protected override BTState BTUpdate()
 {
     if (_curTask == null)
     {
         ReInit();
     }
     while (_curTask != null)
     {
         var state = _curTask.__BTUpdate();
         if (state == BTState.Running)
         {
             return(BTState.Running);
         }
         if (state == TargetState)
         {
             return(TargetState);
         }
         _curTask = _curTask.NextBt;
         _curTask?.__BTStart();
     }
     return(BTState.Running);
 }
Esempio n. 6
0
        protected override BTState BTUpdate()
        {
            if (Time.time < _endTime)
            {
                return(BTState.Running);
            }

            switch (BTCompareResultType)
            {
            case BTCompareType.ExecuteChild:
                if (!_curTask)
                {
                    _curTask = ChildTasks[0];
                    _curTask.__BTStart();
                }
                return(_curTask.__BTUpdate());

            case BTCompareType.ReturnResult:
                return(FinishState);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }