Example #1
0
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);
            MyObjectBuilder_BehaviorTreeDecoratorNode node = nodeDefinition as MyObjectBuilder_BehaviorTreeDecoratorNode;

            this.m_defaultReturnValue = (MyBehaviorTreeState)((sbyte)node.DefaultReturnValue);
            this.m_decoratorLogicName = node.DecoratorLogic.GetType().Name;
            this.m_decoratorLogic     = GetDecoratorLogic(node.DecoratorLogic);
            this.m_decoratorLogic.Construct(node.DecoratorLogic);
            if (node.BTNode != null)
            {
                this.m_child = MyBehaviorTreeNodeFactory.CreateBTNode(node.BTNode);
                this.m_child.Construct(node.BTNode, treeDesc);
            }
        }
        public override void Construct(MyObjectBuilder_BehaviorTreeNode nodeDefinition, MyBehaviorTree.MyBehaviorTreeDesc treeDesc)
        {
            base.Construct(nodeDefinition, treeDesc);
            var ob = nodeDefinition as MyObjectBuilder_BehaviorTreeDecoratorNode;

            m_defaultReturnValue = (MyBehaviorTreeState)((byte)ob.DefaultReturnValue);
            m_decoratorLogicName = ob.DecoratorLogic.GetType().Name;

            m_decoratorLogic = GetDecoratorLogic(ob.DecoratorLogic);
            m_decoratorLogic.Construct(ob.DecoratorLogic);

            if (ob.BTNode != null)
            {
                m_child = MyBehaviorTreeNodeFactory.CreateBTNode(ob.BTNode);
                m_child.Construct(ob.BTNode, treeDesc);
            }
        }
 public MyBehaviorTreeDecoratorNode()
 {
     m_child          = null;
     m_decoratorLogic = null;
 }
 public MyBehaviorTreeDecoratorNode()
 {
     m_child = null;
     m_decoratorLogic = null;
 }