How is a DataLayer unloaded from its active state within a level? About OnDataLayerInstance RuntimeStateChanged

Hello everyone, I’m currently studying DataLayers and want to understand exactly how, at runtime, the DataLayer Manager unloads or loads each actor in a DataLayer from the level. By setting breakpoints, I observed that starting from SetDataLayerRuntimeState() the engine follows this path:

UDataLayerManager::SetDataLayerRuntimeState()
→ UDataLayerManager::SetDataLayerInstanceRuntimeState()
→ AWorldDataLayers::SetDataLayerRuntimeState()
→ AWorldDataLayers::ResolveEffectiveRuntimeState()
→ AWorldDataLayers::OnDataLayerRuntimeStateChanged()
→ AWorldDataLayers::OnDataLayerRuntimeStateChanged_Implementation()
→ UDataLayerManager::BroadcastOnDataLayerInstanceRuntimeStateChanged()
→ OnDataLayerInstanceRuntimeStateChanged.Broadcast(InDataLayer, InState);

I believe this line of code is where the DataManager tells the World Partition (or other components) to change the loading status within the DataLayer.

The last line is a delegate broadcast, but I can’t find any OnDataLayerInstanceRuntimeStateChanged.AddUObject calls in the engine source.


I then tried stepping through with breakpoints further, but eventually hit “DataLayerManager.gen.cpp not found” and couldn’t go on. From the disassembled code I saw some EventQueue–like structures, but I’m still puzzled.

Can any engine developer help me? I’d like to know who actually invokes OnDataLayerInstanceRuntimeStateChanged.Broadcast(InDataLayer, InState);.