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

Method OnEnd

Source/Engine/Level/Level.cpp:1416–1450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1414}
1415
1416SceneResult SceneLoader::OnEnd(Args& args)
1417{
1418 PROFILE_CPU_NAMED("End");
1419 Stopwatch time;
1420
1421 // Fire event
1422 CallSceneEvent(SceneEventType::OnSceneLoaded, Scene, SceneId);
1423
1424 time.Stop();
1425 LOG(Info, "Scene loaded in {}ms ({} frames)", (int32)((TotalTime + time.GetTotalSeconds()) * 1000.0), Engine::UpdateCount - StartFrame);
1426
1427#if USE_EDITOR
1428 // Resave assets that use deprecated data format
1429 for (auto& e : Context.DeprecatedPrefabs)
1430 {
1431 AssetReference<Prefab> prefab = e.Item;
1432 LOG(Info, "Resaving asset '{}' that uses deprecated data format", prefab->GetPath());
1433 if (prefab->Resave())
1434 {
1435 LOG(Error, "Failed to resave asset '{}'", prefab->GetPath());
1436 }
1437 }
1438 if (ContentDeprecated::Clear() && args.AssetPath != StringView())
1439 {
1440 LOG(Info, "Resaving asset '{}' that uses deprecated data format", args.AssetPath);
1441 if (saveScene(Scene, args.AssetPath))
1442 {
1443 LOG(Error, "Failed to resave asset '{}'", args.AssetPath);
1444 }
1445 }
1446#endif
1447
1448 NextStage();
1449 return SceneResult::Success;
1450}
1451
1452bool LevelImpl::saveScene(Scene* scene)
1453{

Callers

nothing calls this directly

Calls 5

ResaveMethod · 0.80
ClearFunction · 0.50
StringViewClass · 0.50
StopMethod · 0.45
GetPathMethod · 0.45

Tested by

no test coverage detected