public override EBTResult Tick() { EBTResult tmpResult = EBTResult.Running; IsRunning = true; do { if (!mRepeatForever) { ++mCurrentCount; } if (mCurrentCount > mCount) { tmpResult = EBTResult.Success; IsRunning = false; break; } EBTResult tmpChildResult = ChildNode.Tick(); if (mEndOnFailure && EBTResult.Failed == tmpChildResult) { tmpResult = EBTResult.Failed; IsRunning = false; break; } } while (false); return(tmpResult); }
public override EBTResult Tick() { switch (ChildNode.Tick()) { case EBTResult.Success: case EBTResult.Failed: return(EBTResult.Success); } return(EBTResult.Running); }
public override EBTResult Tick() { mTime += Time.deltaTime; EBTResult tmpResult = EBTResult.Running; if (mTime >= mDelay) { tmpResult = ChildNode.Tick(); } return(tmpResult); }
public override EBTResult Tick() { mTime += Time.deltaTime; if (mTime >= mInterval) { mTime = 0; EBTResult result = ChildNode.Tick(); return(result); } else { return(EBTResult.Running); } }
public override EBTResult Tick() { if (!mIsConditionsComplete) { switch (mLogicOpt) { case EBTLogic.And: foreach (BTConditional conditional in mConditionals) { if (!conditional.Check()) { return(EBTResult.Failed); } } break; case EBTLogic.Or: bool anySuccess = false; foreach (BTConditional conditional in mConditionals) { if (conditional.Check()) { anySuccess = true; break; } } if (!anySuccess) { return(EBTResult.Failed); } break; } } mIsConditionsComplete = true; EBTResult tmpResult = ChildNode.Tick(); if (EBTResult.Running == tmpResult) { IsRunning = true; } return(tmpResult); }