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(); } }
protected override BTState BTUpdate() { if (!_exeChildTask) { return(BTState.Failure); } return(_exeChildTask.__BTUpdate()); }
private BTState ExecuteChildUpdate() { if (!_exeChildTask) { return(BTState.Failure); } return(_exeChildTask.__BTUpdate()); }
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(); } }
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); }
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(); } }