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

Method load

Source/Engine/AI/BehaviorTree.cpp:272–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272Asset::LoadResult BehaviorTree::load()
273{
274 // Load graph
275 const auto surfaceChunk = GetChunk(0);
276 if (surfaceChunk == nullptr)
277 return LoadResult::MissingDataChunk;
278 MemoryReadStream surfaceStream(surfaceChunk->Get(), surfaceChunk->Size());
279 PROFILE_MEM(AI);
280 if (Graph.Load(&surfaceStream, true))
281 {
282 LOG(Warning, "Failed to load graph \'{0}\'", ToString());
283 return LoadResult::Failed;
284 }
285 Graph.Setup(this);
286
287#if USE_EDITOR
288 Level::ScriptsReloadStart.Bind<BehaviorTree, &BehaviorTree::OnScriptsReloadStart>(this);
289 Level::ScriptsReloadEnd.Bind<BehaviorTree, &BehaviorTree::OnScriptsReloadEnd>(this);
290#endif
291
292 return LoadResult::Ok;
293}
294
295void BehaviorTree::unload(bool isReloading)
296{

Callers

nothing calls this directly

Calls 6

GetChunkFunction · 0.85
ToStringFunction · 0.70
GetMethod · 0.45
SizeMethod · 0.45
LoadMethod · 0.45
SetupMethod · 0.45

Tested by

no test coverage detected