当前位置: 首页>>代码示例>>C#>>正文


C# BehaviorTree.Attach方法代码示例

本文整理汇总了C#中behaviac.BehaviorTree.Attach方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorTree.Attach方法的具体用法?C# BehaviorTree.Attach怎么用?C# BehaviorTree.Attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在behaviac.BehaviorTree的用法示例。


在下文中一共展示了BehaviorTree.Attach方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: build_behavior_tree

 public static bool build_behavior_tree(BehaviorTree bt)
 {
     bt.SetClassNameString("BehaviorTree");
     bt.SetId(-1);
     bt.SetName("node_test/event_ut_0");
     #if !BEHAVIAC_RELEASE
     bt.SetAgentType("AgentNodeTest");
     #endif
     // attachments
     {
         Event_bt_node_test_event_ut_0_attach1 attach1 = new Event_bt_node_test_event_ut_0_attach1();
         attach1.SetClassNameString("Event");
         attach1.SetId(1);
     #if !BEHAVIAC_RELEASE
         attach1.SetAgentType("AgentNodeTest");
     #endif
         attach1.Initialize("Self.AgentNodeTest::event_test_void()", "node_test/event_subtree_0", TriggerMode.TM_Return, false);
         bt.Attach(attach1);
         bt.SetHasEvents(bt.HasEvents() | (attach1 is Event));
     }
     {
         Event_bt_node_test_event_ut_0_attach2 attach2 = new Event_bt_node_test_event_ut_0_attach2();
         attach2.SetClassNameString("Event");
         attach2.SetId(2);
     #if !BEHAVIAC_RELEASE
         attach2.SetAgentType("AgentNodeTest");
     #endif
         attach2.Initialize("Self.AgentNodeTest::event_test_int(0)", "node_test/event_subtree_1", TriggerMode.TM_Return, false);
         // pars
         attach2.AddPar("int", "par_event_param_int", "0", "AgentNodeTest::event_test_int::param0");
         bt.Attach(attach2);
         bt.SetHasEvents(bt.HasEvents() | (attach2 is Event));
     }
     {
         Event_bt_node_test_event_ut_0_attach3 attach3 = new Event_bt_node_test_event_ut_0_attach3();
         attach3.SetClassNameString("Event");
         attach3.SetId(3);
     #if !BEHAVIAC_RELEASE
         attach3.SetAgentType("AgentNodeTest");
     #endif
         attach3.Initialize("Self.AgentNodeTest::event_test_int_bool(0,false)", "node_test/event_subtree_2", TriggerMode.TM_Return, false);
         // pars
         attach3.AddPar("int", "par_event_param_int", "0", "AgentNodeTest::event_test_int_bool::param0");
         attach3.AddPar("bool", "par_event_param_int_bool", "false", "AgentNodeTest::event_test_int_bool::param1");
         bt.Attach(attach3);
         bt.SetHasEvents(bt.HasEvents() | (attach3 is Event));
     }
     {
         Event_bt_node_test_event_ut_0_attach4 attach4 = new Event_bt_node_test_event_ut_0_attach4();
         attach4.SetClassNameString("Event");
         attach4.SetId(4);
     #if !BEHAVIAC_RELEASE
         attach4.SetAgentType("AgentNodeTest");
     #endif
         attach4.Initialize("Self.AgentNodeTest::event_test_int_bool_float(0,false,0)", "node_test/event_subtree_3", TriggerMode.TM_Return, false);
         // pars
         attach4.AddPar("int", "par_event_param_int", "0", "AgentNodeTest::event_test_int_bool_float::param0");
         attach4.AddPar("bool", "par_event_param_bool", "false", "AgentNodeTest::event_test_int_bool_float::param1");
         attach4.AddPar("float", "par_event_param_float", "0", "AgentNodeTest::event_test_int_bool_float::param2");
         bt.Attach(attach4);
         bt.SetHasEvents(bt.HasEvents() | (attach4 is Event));
     }
     // children
     {
         Sequence node0 = new Sequence();
         node0.SetClassNameString("Sequence");
         node0.SetId(0);
     #if !BEHAVIAC_RELEASE
         node0.SetAgentType("AgentNodeTest");
     #endif
         bt.AddChild(node0);
         {
             WaitforSignal node5 = new WaitforSignal();
             node5.SetClassNameString("WaitforSignal");
             node5.SetId(5);
     #if !BEHAVIAC_RELEASE
             node5.SetAgentType("AgentNodeTest");
     #endif
             // attachments
             {
                 Predicate_bt_node_test_event_ut_0_attach6 attach6 = new Predicate_bt_node_test_event_ut_0_attach6();
                 attach6.SetClassNameString("Predicate");
                 attach6.SetId(6);
     #if !BEHAVIAC_RELEASE
                 attach6.SetAgentType("AgentNodeTest");
     #endif
                 node5.Attach(attach6);
             }
             node0.AddChild(node5);
             node0.SetHasEvents(node0.HasEvents() | node5.HasEvents());
         }
         {
             Action_bt_node_test_event_ut_0_node7 node7 = new Action_bt_node_test_event_ut_0_node7();
             node7.SetClassNameString("Action");
             node7.SetId(7);
     #if !BEHAVIAC_RELEASE
             node7.SetAgentType("AgentNodeTest");
     #endif
             node0.AddChild(node7);
             node0.SetHasEvents(node0.HasEvents() | node7.HasEvents());
//.........这里部分代码省略.........
开发者ID:nusus,项目名称:behaviac,代码行数:101,代码来源:generated_behaviors.cs


注:本文中的behaviac.BehaviorTree.Attach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。