pub fn loading_progress_system(
manager: Res<'_, ChunkManager>,
loading_state: ResMut<'_, WorldLoadingState>,
progress_writer: MessageWriter<'_, LoadingProgress>,
ready_writer: MessageWriter<'_, WorldReady>,
)Expand description
Tracks initial chunk loading and emits LoadingProgress and WorldReady.
Scheduled in Update, ordered after GeneratorSystems so that any
chunks completed in the current frame are already counted before progress
is computed.
On the first invocation, the expected chunk count is derived from
ChunkManager::load_distance and cached in WorldLoadingState::expected.
Subsequent frames skip this computation and go straight to the progress
check.
Once WorldLoadingState::ready is true (set after WorldReady
fires), the system returns immediately without writing any messages.