public void Update(BehaviourTreeRunner runner, float deltaTime) { if (mRoot == null) { IsComplate = true; return; } if (RuntimeNode == null) { IsComplate = false; #if UNITY_EDITOR runner.NotifyBehaviourTreeBegin(); #endif RuntimeNode = mRoot; RuntimeNode.Visit(runner); } else { RuntimeNode.Tick(runner, Time.deltaTime); } VisitChildren(runner, RuntimeNode); State = mRoot.State; if (RuntimeNode == null) { IsComplate = true; } #if UNITY_EDITOR runner.NotifyBehaviourTreeFrame(); if (IsComplate) { runner.NotifyBehaviourTreeEnd(); } #endif }
public override RuntimeValueNode Evaluate() { return(RuntimeNode.Create( Operator.Right.Root, RuntimeScope ).Evaluate()); }
public static RuntimeConditionalNode Create(Node node, RuntimeScope scope, RuntimeNode subscope) { switch (node) { case IfConditionNode n: return(new RuntimeIfConditionNode(scope, n, subscope)); } return(null); }
public override RuntimeValueNode Evaluate() { var scopeEx = Expression as ScopeExpression; return(RuntimeConditionalNode.Create( scopeEx.Root, RuntimeScope, RuntimeNode.Create( scopeEx.Subscope, RuntimeScope ) ).Evaluate()); }
public override RuntimeValueNode Evaluate() { return(RuntimeNode.Create(Expression.Root, RuntimeScope).Evaluate()); }
public RuntimeIfConditionNode(RuntimeScope parent, IfConditionNode ifNode, RuntimeNode subscope) : base(parent, ifNode) { Subscope = subscope; }