protected override bool onEvaluate(TBTWorkingData wData) { TBTActionParellelContext thisContext = getContext <TBTActionParellelContext>(wData); initListTo <bool>(thisContext.evaluationStatus, false); bool finalResult = false; for (int i = 0; i < GetChildCount(); i++) { TBTAction node = GetChild <TBTAction>(i); bool ret = node.Evaluate(wData); if (_evaluationRelationShip == ECHILDREN_RELATIONSHIP.AND && ret == false) { finalResult = false; break; } if (ret) { finalResult = true; } thisContext.evaluationStatus[i] = ret; } return(finalResult); }
protected virtual bool onEvaluate(TBTWorkingData wData) { return(true); }
public void Transition(TBTWorkingData wData) { onTransition(wData); }
public int Update(TBTWorkingData wData) { return(onUpdate(wData)); }
public bool Evaluate(TBTWorkingData wData) { return((_precondition == null || _precondition.IsTrue(wData)) && onEvaluate(wData)); }
protected virtual void onTransition(TBTWorkingData wData) { }
protected virtual int onUpdate(TBTWorkingData wData) { return(TBTRunningStatus.FINISHED); }
public override bool IsTrue(TBTWorkingData wData) { return(!GetChild <TBTPrecondition>(0).IsTrue(wData)); }
public override bool IsTrue(/*in*/ TBTWorkingData wData) { return(GetChild <TBTPrecondition>(0).IsTrue(wData) || GetChild <TBTPrecondition>(1).IsTrue(wData)); }
public override bool IsTrue(/*in*/ TBTWorkingData wData) { return(false); }
public abstract bool IsTrue(TBTWorkingData wData);
protected virtual void onExit(TBTWorkingData wData, int runningStatus) { }
protected virtual void onEnter(TBTWorkingData wData) { }
protected T getUserContexData <T>(TBTWorkingData wData) where T : class, new() { return(getContext <TBTActionLeafContext>(wData).GetUserData <T>()); }