示例#1
0
        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);
        }
示例#2
0
 protected virtual bool onEvaluate(TBTWorkingData wData)
 {
     return(true);
 }
示例#3
0
 public void Transition(TBTWorkingData wData)
 {
     onTransition(wData);
 }
示例#4
0
 public int Update(TBTWorkingData wData)
 {
     return(onUpdate(wData));
 }
示例#5
0
 public bool Evaluate(TBTWorkingData wData)
 {
     return((_precondition == null || _precondition.IsTrue(wData)) && onEvaluate(wData));
 }
示例#6
0
 protected virtual void onTransition(TBTWorkingData wData)
 {
 }
示例#7
0
 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));
 }
示例#10
0
 public override bool IsTrue(/*in*/ TBTWorkingData wData)
 {
     return(false);
 }
示例#11
0
 public abstract bool IsTrue(TBTWorkingData wData);
示例#12
0
 protected virtual void onExit(TBTWorkingData wData, int runningStatus)
 {
 }
示例#13
0
 protected virtual void onEnter(TBTWorkingData wData)
 {
 }
示例#14
0
 protected T getUserContexData <T>(TBTWorkingData wData) where T : class, new()
 {
     return(getContext <TBTActionLeafContext>(wData).GetUserData <T>());
 }