コード例 #1
0
        public static bool build_behavior_tree(BehaviorTree bt)
        {
            bt.SetClassNameString("BehaviorTree");
            bt.SetId(-1);
            bt.SetName("WrapperAI/FireTrapRand");
            bt.AddPar("Assets.Scripts.GameLogic.SkillSlotType", "p_curSlotType", "SLOT_SKILL_0", string.Empty);
            bt.AddPar("uint", "p_targetID", "0", string.Empty);
            bt.AddPar("int", "p_srchRange", "0", string.Empty);
            bt.AddPar("UnityEngine.Vector3", "p_AttackMoveDest", "{kEpsilon=0;x=0;y=0;z=0;}", string.Empty);
            bt.AddPar("bool", "p_IsAttackMove_Attack", "false", string.Empty);
            bt.AddPar("bool", "p_AttackIsFinished", "true", string.Empty);
            bt.AddPar("uint", "p_CmdID", "0", string.Empty);
            bt.AddPar("UnityEngine.Vector3", "p_attackPathCurTargetPos", "{kEpsilon=0;x=0;y=0;z=0;}", string.Empty);
            bt.AddPar("int", "p_waitFrame", "0", string.Empty);
            DecoratorLoop_bt_WrapperAI_FireTrapRand_node14 pChild = new DecoratorLoop_bt_WrapperAI_FireTrapRand_node14();

            pChild.SetClassNameString("DecoratorLoop");
            pChild.SetId(14);
            bt.AddChild(pChild);
            SelectorLoop loop = new SelectorLoop();

            loop.SetClassNameString("SelectorLoop");
            loop.SetId(7);
            pChild.AddChild(loop);
            WithPrecondition precondition = new WithPrecondition();

            precondition.SetClassNameString("WithPrecondition");
            precondition.SetId(11);
            loop.AddChild(precondition);
            Or or = new Or();

            or.SetClassNameString("Or");
            or.SetId(1);
            precondition.AddChild(or);
            Condition_bt_WrapperAI_FireTrapRand_node12 _node2 = new Condition_bt_WrapperAI_FireTrapRand_node12();

            _node2.SetClassNameString("Condition");
            _node2.SetId(12);
            or.AddChild(_node2);
            or.SetHasEvents(or.HasEvents() | _node2.HasEvents());
            Condition_bt_WrapperAI_FireTrapRand_node2 _node3 = new Condition_bt_WrapperAI_FireTrapRand_node2();

            _node3.SetClassNameString("Condition");
            _node3.SetId(2);
            or.AddChild(_node3);
            or.SetHasEvents(or.HasEvents() | _node3.HasEvents());
            Condition_bt_WrapperAI_FireTrapRand_node3 _node4 = new Condition_bt_WrapperAI_FireTrapRand_node3();

            _node4.SetClassNameString("Condition");
            _node4.SetId(3);
            or.AddChild(_node4);
            or.SetHasEvents(or.HasEvents() | _node4.HasEvents());
            precondition.SetHasEvents(precondition.HasEvents() | or.HasEvents());
            Sequence sequence = new Sequence();

            sequence.SetClassNameString("Sequence");
            sequence.SetId(0x51);
            precondition.AddChild(sequence);
            Sequence sequence2 = new Sequence();

            sequence2.SetClassNameString("Sequence");
            sequence2.SetId(0x56);
            sequence.AddChild(sequence2);
            Condition_bt_WrapperAI_FireTrapRand_node30 _node5 = new Condition_bt_WrapperAI_FireTrapRand_node30();

            _node5.SetClassNameString("Condition");
            _node5.SetId(30);
            sequence2.AddChild(_node5);
            sequence2.SetHasEvents(sequence2.HasEvents() | _node5.HasEvents());
            Action_bt_WrapperAI_FireTrapRand_node88 _node6 = new Action_bt_WrapperAI_FireTrapRand_node88();

            _node6.SetClassNameString("Action");
            _node6.SetId(0x58);
            sequence2.AddChild(_node6);
            sequence2.SetHasEvents(sequence2.HasEvents() | _node6.HasEvents());
            Action_bt_WrapperAI_FireTrapRand_node91 _node7 = new Action_bt_WrapperAI_FireTrapRand_node91();

            _node7.SetClassNameString("Action");
            _node7.SetId(0x5b);
            sequence2.AddChild(_node7);
            sequence2.SetHasEvents(sequence2.HasEvents() | _node7.HasEvents());
            DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node92 _node8 = new DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node92();

            _node8.SetClassNameString("DecoratorLoopUntil");
            _node8.SetId(0x5c);
            sequence2.AddChild(_node8);
            Condition_bt_WrapperAI_FireTrapRand_node93 _node9 = new Condition_bt_WrapperAI_FireTrapRand_node93();

            _node9.SetClassNameString("Condition");
            _node9.SetId(0x5d);
            _node8.AddChild(_node9);
            _node8.SetHasEvents(_node8.HasEvents() | _node9.HasEvents());
            sequence2.SetHasEvents(sequence2.HasEvents() | _node8.HasEvents());
            sequence.SetHasEvents(sequence.HasEvents() | sequence2.HasEvents());
            DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node4 _node10 = new DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node4();

            _node10.SetClassNameString("DecoratorLoopUntil");
            _node10.SetId(4);
            sequence.AddChild(_node10);
            Condition_bt_WrapperAI_FireTrapRand_node6 _node11 = new Condition_bt_WrapperAI_FireTrapRand_node6();

            _node11.SetClassNameString("Condition");
            _node11.SetId(6);
            _node10.AddChild(_node11);
            _node10.SetHasEvents(_node10.HasEvents() | _node11.HasEvents());
            sequence.SetHasEvents(sequence.HasEvents() | _node10.HasEvents());
            Sequence sequence3 = new Sequence();

            sequence3.SetClassNameString("Sequence");
            sequence3.SetId(8);
            sequence.AddChild(sequence3);
            Compute_bt_WrapperAI_FireTrapRand_node0 _node12 = new Compute_bt_WrapperAI_FireTrapRand_node0();

            _node12.SetClassNameString("Compute");
            _node12.SetId(0);
            sequence3.AddChild(_node12);
            sequence3.SetHasEvents(sequence3.HasEvents() | _node12.HasEvents());
            WaitFrames_bt_WrapperAI_FireTrapRand_node5 _node13 = new WaitFrames_bt_WrapperAI_FireTrapRand_node5();

            _node13.SetClassNameString("WaitFrames");
            _node13.SetId(5);
            sequence3.AddChild(_node13);
            sequence3.SetHasEvents(sequence3.HasEvents() | _node13.HasEvents());
            sequence.SetHasEvents(sequence.HasEvents() | sequence3.HasEvents());
            precondition.SetHasEvents(precondition.HasEvents() | sequence.HasEvents());
            loop.SetHasEvents(loop.HasEvents() | precondition.HasEvents());
            pChild.SetHasEvents(pChild.HasEvents() | loop.HasEvents());
            bt.SetHasEvents(bt.HasEvents() | pChild.HasEvents());
            return(true);
        }
コード例 #2
0
        public static bool build_behavior_tree(BehaviorTree bt)
        {
            bt.SetClassNameString("BehaviorTree");
            bt.SetId(-1);
            bt.SetName("WrapperAI/FireTrapRand");
            bt.AddPar("Assets.Scripts.GameLogic.SkillSlotType", "p_curSlotType", "SLOT_SKILL_0", string.Empty);
            bt.AddPar("uint", "p_targetID", "0", string.Empty);
            bt.AddPar("int", "p_srchRange", "0", string.Empty);
            bt.AddPar("UnityEngine.Vector3", "p_AttackMoveDest", "{kEpsilon=0;x=0;y=0;z=0;}", string.Empty);
            bt.AddPar("bool", "p_IsAttackMove_Attack", "false", string.Empty);
            bt.AddPar("bool", "p_AttackIsFinished", "true", string.Empty);
            bt.AddPar("uint", "p_CmdID", "0", string.Empty);
            bt.AddPar("UnityEngine.Vector3", "p_attackPathCurTargetPos", "{kEpsilon=0;x=0;y=0;z=0;}", string.Empty);
            bt.AddPar("int", "p_waitFrame", "0", string.Empty);
            DecoratorLoop_bt_WrapperAI_FireTrapRand_node14 decoratorLoop_bt_WrapperAI_FireTrapRand_node = new DecoratorLoop_bt_WrapperAI_FireTrapRand_node14();

            decoratorLoop_bt_WrapperAI_FireTrapRand_node.SetClassNameString("DecoratorLoop");
            decoratorLoop_bt_WrapperAI_FireTrapRand_node.SetId(14);
            bt.AddChild(decoratorLoop_bt_WrapperAI_FireTrapRand_node);
            SelectorLoop selectorLoop = new SelectorLoop();

            selectorLoop.SetClassNameString("SelectorLoop");
            selectorLoop.SetId(7);
            decoratorLoop_bt_WrapperAI_FireTrapRand_node.AddChild(selectorLoop);
            WithPrecondition withPrecondition = new WithPrecondition();

            withPrecondition.SetClassNameString("WithPrecondition");
            withPrecondition.SetId(11);
            selectorLoop.AddChild(withPrecondition);
            Or or = new Or();

            or.SetClassNameString("Or");
            or.SetId(1);
            withPrecondition.AddChild(or);
            Condition_bt_WrapperAI_FireTrapRand_node12 condition_bt_WrapperAI_FireTrapRand_node = new Condition_bt_WrapperAI_FireTrapRand_node12();

            condition_bt_WrapperAI_FireTrapRand_node.SetClassNameString("Condition");
            condition_bt_WrapperAI_FireTrapRand_node.SetId(12);
            or.AddChild(condition_bt_WrapperAI_FireTrapRand_node);
            or.SetHasEvents(or.HasEvents() | condition_bt_WrapperAI_FireTrapRand_node.HasEvents());
            Condition_bt_WrapperAI_FireTrapRand_node2 condition_bt_WrapperAI_FireTrapRand_node2 = new Condition_bt_WrapperAI_FireTrapRand_node2();

            condition_bt_WrapperAI_FireTrapRand_node2.SetClassNameString("Condition");
            condition_bt_WrapperAI_FireTrapRand_node2.SetId(2);
            or.AddChild(condition_bt_WrapperAI_FireTrapRand_node2);
            or.SetHasEvents(or.HasEvents() | condition_bt_WrapperAI_FireTrapRand_node2.HasEvents());
            Condition_bt_WrapperAI_FireTrapRand_node3 condition_bt_WrapperAI_FireTrapRand_node3 = new Condition_bt_WrapperAI_FireTrapRand_node3();

            condition_bt_WrapperAI_FireTrapRand_node3.SetClassNameString("Condition");
            condition_bt_WrapperAI_FireTrapRand_node3.SetId(3);
            or.AddChild(condition_bt_WrapperAI_FireTrapRand_node3);
            or.SetHasEvents(or.HasEvents() | condition_bt_WrapperAI_FireTrapRand_node3.HasEvents());
            withPrecondition.SetHasEvents(withPrecondition.HasEvents() | or.HasEvents());
            Sequence sequence = new Sequence();

            sequence.SetClassNameString("Sequence");
            sequence.SetId(81);
            withPrecondition.AddChild(sequence);
            Sequence sequence2 = new Sequence();

            sequence2.SetClassNameString("Sequence");
            sequence2.SetId(86);
            sequence.AddChild(sequence2);
            Condition_bt_WrapperAI_FireTrapRand_node30 condition_bt_WrapperAI_FireTrapRand_node4 = new Condition_bt_WrapperAI_FireTrapRand_node30();

            condition_bt_WrapperAI_FireTrapRand_node4.SetClassNameString("Condition");
            condition_bt_WrapperAI_FireTrapRand_node4.SetId(30);
            sequence2.AddChild(condition_bt_WrapperAI_FireTrapRand_node4);
            sequence2.SetHasEvents(sequence2.HasEvents() | condition_bt_WrapperAI_FireTrapRand_node4.HasEvents());
            Action_bt_WrapperAI_FireTrapRand_node88 action_bt_WrapperAI_FireTrapRand_node = new Action_bt_WrapperAI_FireTrapRand_node88();

            action_bt_WrapperAI_FireTrapRand_node.SetClassNameString("Action");
            action_bt_WrapperAI_FireTrapRand_node.SetId(88);
            sequence2.AddChild(action_bt_WrapperAI_FireTrapRand_node);
            sequence2.SetHasEvents(sequence2.HasEvents() | action_bt_WrapperAI_FireTrapRand_node.HasEvents());
            Action_bt_WrapperAI_FireTrapRand_node91 action_bt_WrapperAI_FireTrapRand_node2 = new Action_bt_WrapperAI_FireTrapRand_node91();

            action_bt_WrapperAI_FireTrapRand_node2.SetClassNameString("Action");
            action_bt_WrapperAI_FireTrapRand_node2.SetId(91);
            sequence2.AddChild(action_bt_WrapperAI_FireTrapRand_node2);
            sequence2.SetHasEvents(sequence2.HasEvents() | action_bt_WrapperAI_FireTrapRand_node2.HasEvents());
            DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node92 decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node = new DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node92();

            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node.SetClassNameString("DecoratorLoopUntil");
            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node.SetId(92);
            sequence2.AddChild(decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node);
            Condition_bt_WrapperAI_FireTrapRand_node93 condition_bt_WrapperAI_FireTrapRand_node5 = new Condition_bt_WrapperAI_FireTrapRand_node93();

            condition_bt_WrapperAI_FireTrapRand_node5.SetClassNameString("Condition");
            condition_bt_WrapperAI_FireTrapRand_node5.SetId(93);
            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node.AddChild(condition_bt_WrapperAI_FireTrapRand_node5);
            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node.SetHasEvents(decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node.HasEvents() | condition_bt_WrapperAI_FireTrapRand_node5.HasEvents());
            sequence2.SetHasEvents(sequence2.HasEvents() | decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node.HasEvents());
            sequence.SetHasEvents(sequence.HasEvents() | sequence2.HasEvents());
            DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node4 decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2 = new DecoratorLoopUntil_bt_WrapperAI_FireTrapRand_node4();

            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2.SetClassNameString("DecoratorLoopUntil");
            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2.SetId(4);
            sequence.AddChild(decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2);
            Condition_bt_WrapperAI_FireTrapRand_node6 condition_bt_WrapperAI_FireTrapRand_node6 = new Condition_bt_WrapperAI_FireTrapRand_node6();

            condition_bt_WrapperAI_FireTrapRand_node6.SetClassNameString("Condition");
            condition_bt_WrapperAI_FireTrapRand_node6.SetId(6);
            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2.AddChild(condition_bt_WrapperAI_FireTrapRand_node6);
            decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2.SetHasEvents(decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2.HasEvents() | condition_bt_WrapperAI_FireTrapRand_node6.HasEvents());
            sequence.SetHasEvents(sequence.HasEvents() | decoratorLoopUntil_bt_WrapperAI_FireTrapRand_node2.HasEvents());
            Sequence sequence3 = new Sequence();

            sequence3.SetClassNameString("Sequence");
            sequence3.SetId(8);
            sequence.AddChild(sequence3);
            Compute_bt_WrapperAI_FireTrapRand_node0 compute_bt_WrapperAI_FireTrapRand_node = new Compute_bt_WrapperAI_FireTrapRand_node0();

            compute_bt_WrapperAI_FireTrapRand_node.SetClassNameString("Compute");
            compute_bt_WrapperAI_FireTrapRand_node.SetId(0);
            sequence3.AddChild(compute_bt_WrapperAI_FireTrapRand_node);
            sequence3.SetHasEvents(sequence3.HasEvents() | compute_bt_WrapperAI_FireTrapRand_node.HasEvents());
            WaitFrames_bt_WrapperAI_FireTrapRand_node5 waitFrames_bt_WrapperAI_FireTrapRand_node = new WaitFrames_bt_WrapperAI_FireTrapRand_node5();

            waitFrames_bt_WrapperAI_FireTrapRand_node.SetClassNameString("WaitFrames");
            waitFrames_bt_WrapperAI_FireTrapRand_node.SetId(5);
            sequence3.AddChild(waitFrames_bt_WrapperAI_FireTrapRand_node);
            sequence3.SetHasEvents(sequence3.HasEvents() | waitFrames_bt_WrapperAI_FireTrapRand_node.HasEvents());
            sequence.SetHasEvents(sequence.HasEvents() | sequence3.HasEvents());
            withPrecondition.SetHasEvents(withPrecondition.HasEvents() | sequence.HasEvents());
            selectorLoop.SetHasEvents(selectorLoop.HasEvents() | withPrecondition.HasEvents());
            decoratorLoop_bt_WrapperAI_FireTrapRand_node.SetHasEvents(decoratorLoop_bt_WrapperAI_FireTrapRand_node.HasEvents() | selectorLoop.HasEvents());
            bt.SetHasEvents(bt.HasEvents() | decoratorLoop_bt_WrapperAI_FireTrapRand_node.HasEvents());
            return(true);
        }