本文整理汇总了C#中behaviac.Selector.Attach方法的典型用法代码示例。如果您正苦于以下问题:C# Selector.Attach方法的具体用法?C# Selector.Attach怎么用?C# Selector.Attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类behaviac.Selector
的用法示例。
在下文中一共展示了Selector.Attach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: build_behavior_tree
public static bool build_behavior_tree(BehaviorTree bt)
{
bt.SetClassNameString("BehaviorTree");
bt.SetId(-1);
bt.SetName("node_test/PreconditionEffectorTest/PreconditionEffectorTest_0");
bt.IsFSM = false;
#if !BEHAVIAC_RELEASE
bt.SetAgentType("PreconEffectorAgent");
#endif
// children
{
Selector node3 = new Selector();
node3.SetClassNameString("Selector");
node3.SetId(3);
#if !BEHAVIAC_RELEASE
node3.SetAgentType("PreconEffectorAgent");
#endif
// attachments
{
Precondition_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach0 attach0 = new Precondition_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach0();
attach0.SetClassNameString("Precondition");
attach0.SetId(0);
#if !BEHAVIAC_RELEASE
attach0.SetAgentType("PreconEffectorAgent");
#endif
node3.Attach(attach0, true, false, false);
}
bt.AddChild(node3);
{
Action_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_node8 node8 = new Action_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_node8();
node8.SetClassNameString("Action");
node8.SetId(8);
#if !BEHAVIAC_RELEASE
node8.SetAgentType("PreconEffectorAgent");
#endif
// attachments
{
Precondition_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach1 attach1 = new Precondition_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach1();
attach1.SetClassNameString("Precondition");
attach1.SetId(1);
#if !BEHAVIAC_RELEASE
attach1.SetAgentType("PreconEffectorAgent");
#endif
node8.Attach(attach1, true, false, false);
}
{
Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach2 attach2 = new Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach2();
attach2.SetClassNameString("Effector");
attach2.SetId(2);
#if !BEHAVIAC_RELEASE
attach2.SetAgentType("PreconEffectorAgent");
#endif
node8.Attach(attach2, false, true, false);
}
{
Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach4 attach4 = new Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach4();
attach4.SetClassNameString("Effector");
attach4.SetId(4);
#if !BEHAVIAC_RELEASE
attach4.SetAgentType("PreconEffectorAgent");
#endif
node8.Attach(attach4, false, true, false);
}
node3.AddChild(node8);
node3.SetHasEvents(node3.HasEvents() | node8.HasEvents());
}
{
Action_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_node9 node9 = new Action_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_node9();
node9.SetClassNameString("Action");
node9.SetId(9);
#if !BEHAVIAC_RELEASE
node9.SetAgentType("PreconEffectorAgent");
#endif
// attachments
{
Precondition_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach10 attach10 = new Precondition_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach10();
attach10.SetClassNameString("Precondition");
attach10.SetId(10);
#if !BEHAVIAC_RELEASE
attach10.SetAgentType("PreconEffectorAgent");
#endif
node9.Attach(attach10, true, false, false);
}
{
Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach5 attach5 = new Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach5();
attach5.SetClassNameString("Effector");
attach5.SetId(5);
#if !BEHAVIAC_RELEASE
attach5.SetAgentType("PreconEffectorAgent");
#endif
node9.Attach(attach5, false, true, false);
}
{
Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach6 attach6 = new Effector_bt_node_test_PreconditionEffectorTest_PreconditionEffectorTest_0_attach6();
attach6.SetClassNameString("Effector");
attach6.SetId(6);
#if !BEHAVIAC_RELEASE
attach6.SetAgentType("PreconEffectorAgent");
#endif
node9.Attach(attach6, false, true, false);
//.........这里部分代码省略.........
示例2: build_behavior_tree
public static bool build_behavior_tree(BehaviorTree bt)
{
bt.SetClassNameString("BehaviorTree");
bt.SetId(-1);
bt.SetName("node_test/predicate_selector_ut_5");
#if !BEHAVIAC_RELEASE
bt.SetAgentType("AgentNodeTest");
#endif
// children
{
Selector node0 = new Selector();
node0.SetClassNameString("Selector");
node0.SetId(0);
#if !BEHAVIAC_RELEASE
node0.SetAgentType("AgentNodeTest");
#endif
// attachments
{
Predicate_bt_node_test_predicate_selector_ut_5_attach1 attach1 = new Predicate_bt_node_test_predicate_selector_ut_5_attach1();
attach1.SetClassNameString("Predicate");
attach1.SetId(1);
#if !BEHAVIAC_RELEASE
attach1.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach1);
}
{
Predicate_bt_node_test_predicate_selector_ut_5_attach3 attach3 = new Predicate_bt_node_test_predicate_selector_ut_5_attach3();
attach3.SetClassNameString("Predicate");
attach3.SetId(3);
#if !BEHAVIAC_RELEASE
attach3.SetAgentType("AgentNodeTest");
#endif
node0.Attach(attach3);
}
{
Predicate_bt_node_test_predicate_selector_ut_5_attach6 attach6 = new Predicate_bt_node_test_predicate_selector_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_selector_ut_5_node5 node5 = new Action_bt_node_test_predicate_selector_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_selector_ut_5_node4 node4 = new Action_bt_node_test_predicate_selector_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_selector_ut_5_node2 node2 = new Action_bt_node_test_predicate_selector_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_selector_ut_5_node7 node7 = new Action_bt_node_test_predicate_selector_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;
}