MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Setup

Method Setup

Source/Engine/AI/BehaviorTree.cpp:77–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void BehaviorTreeGraph::Setup(BehaviorTree* tree)
78{
79 // Find root node
80 Node* root = nullptr;
81 Root = nullptr;
82 for (Node& node : Nodes)
83 {
84 if (node.Instance && node.GroupID == 19 && node.TypeID == 2)
85 {
86 // Find root node
87 if (node.Instance->GetTypeHandle() == BehaviorTreeRootNode::TypeInitializer)
88 Root = (BehaviorTreeRootNode*)node.Instance;
89 root = &node;
90 break;
91 }
92 }
93 if (!Root)
94 return;
95
96 // Setup nodes hierarchy
97 NodesCount = 0;
98 NodesStatesSize = 0;
99 SetupRecursive(*root);
100
101 // Init graph with asset
102 Root->Init(tree);
103}
104
105void BehaviorTreeGraph::SetupRecursive(Node& node)
106{

Callers 2

OnScriptsReloadEndMethod · 0.45
loadMethod · 0.45

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected