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

Method StartLogic

Source/Engine/AI/Behavior.cpp:123–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void Behavior::StartLogic()
124{
125 if (_result == BehaviorUpdateResult::Running)
126 return;
127 PROFILE_CPU();
128
129 // Ensure to have tree loaded on play
130 CHECK(Tree && !Tree->WaitForLoaded());
131 BehaviorTree* tree = Tree.Get();
132 CHECK(tree->Graph.Root);
133
134 // Setup state
135 _result = BehaviorUpdateResult::Running;
136 _accumulatedTime = 0.0f;
137 _totalTime = 0;
138
139 // Init knowledge
140 _knowledge.InitMemory(tree);
141}
142
143void Behavior::StopLogic(BehaviorUpdateResult result)
144{

Callers

nothing calls this directly

Calls 3

WaitForLoadedMethod · 0.80
InitMemoryMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected