public override StausResult Tick(DataBase dataBase = null) { if (_activeChild == null) { DoEvaluate(dataBase); if (_activeChild == null) { return(StausResult.FAIL); } } currentTime += Time.fixedDeltaTime; if (currentTime < sTime) { StausResult result = _activeChild.Tick(dataBase); if (result == StausResult.SUCCESS || result == StausResult.FAIL) { _activeChild = null; } return(StausResult.RUNNING); } currentTime = 0.0f; _activeChild = null; return(StausResult.SUCCESS); }
public override StausResult Tick(DataBase dataBase = null) { StausResult result = StausResult.RUNNING; for (int i = 0; i < _childNode.Count; ++i) { result = _childNode[i].Tick(dataBase); } return(result); }
public override StausResult Tick(DataBase dataBase = null) { StausResult result = StausResult.RUNNING; result = node.Tick(dataBase); if (result == StausResult.FAIL) { return(StausResult.FAIL); } return(result); }
public override StausResult Tick(DataBase dataBase = null) { if (_activeChild == null) { DoEvaluate(dataBase); if (_activeChild == null) { return(StausResult.FAIL); } } //Debug.Log(_activeChild.NodeName); StausResult result = _activeChild.Tick(dataBase); if (result == StausResult.SUCCESS || result == StausResult.FAIL) { _activeChild = null; } return(result); }
public override StausResult Tick(DataBase dataBase = null) { if (_activeChild == null) { int index = DoEvaluate(dataBase); _activeChild = _childNode[index]; if (_activeChild == null) { return(StausResult.FAIL); } } StausResult result = _activeChild.Tick(dataBase); //Debug.Log(result); if (result == StausResult.SUCCESS || result == StausResult.FAIL) { _activeChild = null; } return(result); }
public override StausResult Tick(DataBase dataBase = null) { StausResult stausResult = StausResult.SUCCESS; if (bTActionStaus == BTActionStaus.READY) { Enter(dataBase); bTActionStaus = BTActionStaus.RUNNING; } if (bTActionStaus == BTActionStaus.RUNNING) { stausResult = Execute(dataBase); if (stausResult != StausResult.RUNNING) { Exit(dataBase); bTActionStaus = BTActionStaus.READY; } } return(stausResult); }
public override StausResult Tick(DataBase dataBase = null) { StausResult result = StausResult.RUNNING; if (RepeatCount > 0) { if (RepeatNum < RepeatCount) { result = node.Tick(dataBase); } else { return(StausResult.SUCCESS); } ++RepeatNum; } else { result = node.Tick(dataBase); } return(result); }
public override StausResult Tick(DataBase dataBase = null) { StausResult result = StausResult.SUCCESS; if (currentNode == null) { currentNode = _childNodeQueue.Dequeue(); _childNode.Add(currentNode); //保存结点 } result = currentNode.Tick(dataBase); if (result == StausResult.FAIL) { ReStart(); return(result); } if (result == StausResult.SUCCESS) { ++ActionCount; if (ActionCount >= QueueCount) { ReStart(); } else { currentNode = _childNodeQueue.Dequeue(); _childNode.Add(currentNode); } return(StausResult.SUCCESS); } return(StausResult.RUNNING); }