本文整理汇总了C#中behaviac.Sequence.Attach方法的典型用法代码示例。如果您正苦于以下问题:C# Sequence.Attach方法的具体用法?C# Sequence.Attach怎么用?C# Sequence.Attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类behaviac.Sequence
的用法示例。
在下文中一共展示了Sequence.Attach方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: build_behavior_tree
public static bool build_behavior_tree(BehaviorTree bt)
{
bt.SetClassNameString("BehaviorTree");
bt.SetId(-1);
bt.SetName("node_test/action_ut_0");
bt.IsFSM = false;
#if !BEHAVIAC_RELEASE
bt.SetAgentType("AgentNodeTest");
#endif
// pars
bt.AddPar("AgentNodeTest", "int", "par_int_type_0", "0");
bt.AddPar("AgentNodeTest", "int", "par_int_type_1", "0");
bt.AddPar("AgentNodeTest", "int", "par_int_type_2", "300");
bt.AddPar("AgentNodeTest", "UnityEngine.GameObject", "par_go", "null");
bt.AddPar("AgentNodeTest", "ChildNodeTest", "par_child", "null");
// children
{
Sequence node0 = new Sequence();
node0.SetClassNameString("Sequence");
node0.SetId(0);
#if !BEHAVIAC_RELEASE
node0.SetAgentType("AgentNodeTest");
#endif
// attachments
{
Precondition_bt_node_test_action_ut_0_attach15 attach15 = new Precondition_bt_node_test_action_ut_0_attach15();
attach15.SetClassNameString("Precondition");
attach15.SetId(15);
#if !BEHAVIAC_RELEASE
attach15.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach15, true, false, false);
}
bt.AddChild(node0);
{
Action_bt_node_test_action_ut_0_node14 node14 = new Action_bt_node_test_action_ut_0_node14();
node14.SetClassNameString("Action");
node14.SetId(14);
#if !BEHAVIAC_RELEASE
node14.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node14);
node0.SetHasEvents(node0.HasEvents() | node14.HasEvents());
}
{
Assignment_bt_node_test_action_ut_0_node12 node12 = new Assignment_bt_node_test_action_ut_0_node12();
node12.SetClassNameString("Assignment");
node12.SetId(12);
#if !BEHAVIAC_RELEASE
node12.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node12);
node0.SetHasEvents(node0.HasEvents() | node12.HasEvents());
}
{
Condition_bt_node_test_action_ut_0_node13 node13 = new Condition_bt_node_test_action_ut_0_node13();
node13.SetClassNameString("Condition");
node13.SetId(13);
#if !BEHAVIAC_RELEASE
node13.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node13);
node0.SetHasEvents(node0.HasEvents() | node13.HasEvents());
}
{
Assignment_bt_node_test_action_ut_0_node10 node10 = new Assignment_bt_node_test_action_ut_0_node10();
node10.SetClassNameString("Assignment");
node10.SetId(10);
#if !BEHAVIAC_RELEASE
node10.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node10);
node0.SetHasEvents(node0.HasEvents() | node10.HasEvents());
}
{
Condition_bt_node_test_action_ut_0_node11 node11 = new Condition_bt_node_test_action_ut_0_node11();
node11.SetClassNameString("Condition");
node11.SetId(11);
#if !BEHAVIAC_RELEASE
node11.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node11);
node0.SetHasEvents(node0.HasEvents() | node11.HasEvents());
}
{
Condition_bt_node_test_action_ut_0_node8 node8 = new Condition_bt_node_test_action_ut_0_node8();
node8.SetClassNameString("Condition");
node8.SetId(8);
#if !BEHAVIAC_RELEASE
node8.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node8);
node0.SetHasEvents(node0.HasEvents() | node8.HasEvents());
}
{
Action_bt_node_test_action_ut_0_node9 node9 = new Action_bt_node_test_action_ut_0_node9();
node9.SetClassNameString("Action");
node9.SetId(9);
#if !BEHAVIAC_RELEASE
node9.SetAgentType("AgentNodeTest");
//.........这里部分代码省略.........
示例2: build_behavior_tree
public static bool build_behavior_tree(BehaviorTree bt)
{
bt.SetClassNameString("BehaviorTree");
bt.SetId(-1);
bt.SetName("node_test/query_ut_3");
bt.IsFSM = false;
#if !BEHAVIAC_RELEASE
bt.SetAgentType("AgentNodeTest");
#endif
// children
{
Sequence node0 = new Sequence();
node0.SetClassNameString("Sequence");
node0.SetId(0);
#if !BEHAVIAC_RELEASE
node0.SetAgentType("AgentNodeTest");
#endif
// attachments
{
Precondition_bt_node_test_query_ut_3_attach1 attach1 = new Precondition_bt_node_test_query_ut_3_attach1();
attach1.SetClassNameString("Precondition");
attach1.SetId(1);
#if !BEHAVIAC_RELEASE
attach1.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach1, true, false, false);
}
{
Effector_bt_node_test_query_ut_3_attach2 attach2 = new Effector_bt_node_test_query_ut_3_attach2();
attach2.SetClassNameString("Effector");
attach2.SetId(2);
#if !BEHAVIAC_RELEASE
attach2.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach2, false, true, false);
}
bt.AddChild(node0);
{
Query_bt_node_test_query_ut_3_node5 node5 = new Query_bt_node_test_query_ut_3_node5();
node5.SetClassNameString("Query");
node5.SetId(5);
#if !BEHAVIAC_RELEASE
node5.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node5);
node0.SetHasEvents(node0.HasEvents() | node5.HasEvents());
}
{
Sequence node6 = new Sequence();
node6.SetClassNameString("Sequence");
node6.SetId(6);
#if !BEHAVIAC_RELEASE
node6.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node6);
{
Query_bt_node_test_query_ut_3_node3 node3 = new Query_bt_node_test_query_ut_3_node3();
node3.SetClassNameString("Query");
node3.SetId(3);
#if !BEHAVIAC_RELEASE
node3.SetAgentType("AgentNodeTest");
#endif
node6.AddChild(node3);
node6.SetHasEvents(node6.HasEvents() | node3.HasEvents());
}
{
Query_bt_node_test_query_ut_3_node4 node4 = new Query_bt_node_test_query_ut_3_node4();
node4.SetClassNameString("Query");
node4.SetId(4);
#if !BEHAVIAC_RELEASE
node4.SetAgentType("AgentNodeTest");
#endif
node6.AddChild(node4);
node6.SetHasEvents(node6.HasEvents() | node4.HasEvents());
}
node0.SetHasEvents(node0.HasEvents() | node6.HasEvents());
}
bt.SetHasEvents(bt.HasEvents() | node0.HasEvents());
}
return true;
}
示例3: build_behavior_tree
public static bool build_behavior_tree(BehaviorTree bt)
{
bt.SetClassNameString("BehaviorTree");
bt.SetId(-1);
bt.SetName("node_test/predicate_sequence_ut_5");
#if !BEHAVIAC_RELEASE
bt.SetAgentType("AgentNodeTest");
#endif
// children
{
Sequence node0 = new Sequence();
node0.SetClassNameString("Sequence");
node0.SetId(0);
#if !BEHAVIAC_RELEASE
node0.SetAgentType("AgentNodeTest");
#endif
// attachments
{
Predicate_bt_node_test_predicate_sequence_ut_5_attach1 attach1 = new Predicate_bt_node_test_predicate_sequence_ut_5_attach1();
attach1.SetClassNameString("Predicate");
attach1.SetId(1);
#if !BEHAVIAC_RELEASE
attach1.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach1);
}
{
Predicate_bt_node_test_predicate_sequence_ut_5_attach3 attach3 = new Predicate_bt_node_test_predicate_sequence_ut_5_attach3();
attach3.SetClassNameString("Predicate");
attach3.SetId(3);
#if !BEHAVIAC_RELEASE
attach3.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach3);
}
{
Predicate_bt_node_test_predicate_sequence_ut_5_attach6 attach6 = new Predicate_bt_node_test_predicate_sequence_ut_5_attach6();
attach6.SetClassNameString("Predicate");
attach6.SetId(6);
#if !BEHAVIAC_RELEASE
attach6.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach6);
}
bt.AddChild(node0);
{
Action_bt_node_test_predicate_sequence_ut_5_node5 node5 = new Action_bt_node_test_predicate_sequence_ut_5_node5();
node5.SetClassNameString("Action");
node5.SetId(5);
#if !BEHAVIAC_RELEASE
node5.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node5);
node0.SetHasEvents(node0.HasEvents() | node5.HasEvents());
}
{
Action_bt_node_test_predicate_sequence_ut_5_node4 node4 = new Action_bt_node_test_predicate_sequence_ut_5_node4();
node4.SetClassNameString("Action");
node4.SetId(4);
#if !BEHAVIAC_RELEASE
node4.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node4);
node0.SetHasEvents(node0.HasEvents() | node4.HasEvents());
}
{
Action_bt_node_test_predicate_sequence_ut_5_node2 node2 = new Action_bt_node_test_predicate_sequence_ut_5_node2();
node2.SetClassNameString("Action");
node2.SetId(2);
#if !BEHAVIAC_RELEASE
node2.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node2);
node0.SetHasEvents(node0.HasEvents() | node2.HasEvents());
}
{
Action_bt_node_test_predicate_sequence_ut_5_node7 node7 = new Action_bt_node_test_predicate_sequence_ut_5_node7();
node7.SetClassNameString("Action");
node7.SetId(7);
#if !BEHAVIAC_RELEASE
node7.SetAgentType("AgentNodeTest");
#endif
node0.AddChild(node7);
node0.SetHasEvents(node0.HasEvents() | node7.HasEvents());
}
bt.SetHasEvents(bt.HasEvents() | node0.HasEvents());
}
return true;
}