| 1390 | } |
| 1391 | |
| 1392 | SceneResult SceneLoader::OnBeginPlay(Args& args) |
| 1393 | { |
| 1394 | PROFILE_CPU_NAMED("BeginPlay"); |
| 1395 | ASSERT_LOW_LAYER(IsInMainThread()); |
| 1396 | |
| 1397 | // Link scene |
| 1398 | ScopeLock lock(Level::ScenesLock); |
| 1399 | Level::Scenes.Add(Scene); |
| 1400 | |
| 1401 | // TODO: prototype time-slicing with load-balancing for Begin Play: |
| 1402 | // TODO: - collect all actors to enable |
| 1403 | // TODO: - invoke in order OnBeginPlay -> Child Actors Begin -> Child Scripts Begin -> OnEnable for each actor |
| 1404 | // TODO: - consider not drawing level until it's fully loaded (other engine systems should respect this too?) |
| 1405 | // TODO: - consider refactoring Joints creation maybe? to get rid of SceneBeginData |
| 1406 | |
| 1407 | // Start the game for scene objects |
| 1408 | SceneBeginData beginData; |
| 1409 | Scene->BeginPlay(&beginData); |
| 1410 | beginData.OnDone(); |
| 1411 | |
| 1412 | NextStage(); |
| 1413 | return SceneResult::Success; |
| 1414 | } |
| 1415 | |
| 1416 | SceneResult SceneLoader::OnEnd(Args& args) |
| 1417 | { |
nothing calls this directly
no test coverage detected