當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。