Exemplo n.º 1
0
        public override void OnUpdate(float deltaTime)
        {
            BaseDecoratorNode decoratorNode = Node as BaseDecoratorNode;

            decoratorNode.ChildNode.OnUpdate(deltaTime);

            if (decoratorNode.ChildNode.Status == NodeStatus.ERROR)
            {
                decoratorNode.Status = NodeStatus.ERROR;
                return;
            }

            if (decoratorNode.ChildNode.Status != NodeStatus.RUNNING)
            {
                decoratorNode.Status = NodeStatus.FAILED;
            }
        }
Exemplo n.º 2
0
        public override void OnUpdate(float deltaTime)
        {
            BaseDecoratorNode decoratorNode = Node as BaseDecoratorNode;

            decoratorNode.ChildNode.OnUpdate(deltaTime);

            if (decoratorNode.ChildNode.Status == NodeStatus.ERROR)
            {
                decoratorNode.Status = NodeStatus.ERROR;
            }
            else if (decoratorNode.ChildNode.Status == NodeStatus.FAILED)
            {
                decoratorNode.Status = NodeStatus.SUCCESS;
            }
            else if (decoratorNode.ChildNode.Status == NodeStatus.SUCCESS)
            {
                decoratorNode.Status = NodeStatus.FAILED;
            }
        }
 public BehaviourTreeDecoratorBuilder(TFinalizeResult parent, BaseDecoratorNode <TBlackboard> group)
 {
     _parent    = parent;
     _decorator = group;
 }