예제 #1
0
        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());
 }
예제 #3
0
        public static RuntimeConditionalNode Create(Node node, RuntimeScope scope, RuntimeNode subscope)
        {
            switch (node)
            {
            case IfConditionNode n: return(new RuntimeIfConditionNode(scope, n, subscope));
            }

            return(null);
        }
예제 #4
0
        public override RuntimeValueNode Evaluate()
        {
            var scopeEx = Expression as ScopeExpression;

            return(RuntimeConditionalNode.Create(
                       scopeEx.Root,
                       RuntimeScope,
                       RuntimeNode.Create(
                           scopeEx.Subscope,
                           RuntimeScope
                           )
                       ).Evaluate());
        }
예제 #5
0
 public override RuntimeValueNode Evaluate()
 {
     return(RuntimeNode.Create(Expression.Root, RuntimeScope).Evaluate());
 }
 public RuntimeIfConditionNode(RuntimeScope parent, IfConditionNode ifNode, RuntimeNode subscope) : base(parent, ifNode)
 {
     Subscope = subscope;
 }