From 738db4a0944215f612ad421c5df47db3c81f90dc Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Sun, 26 Nov 2023 22:16:14 +0100 Subject: [PATCH] Improve panic when configuring a loading state that is not yet added to the application --- bevy_asset_loader/src/loading_state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bevy_asset_loader/src/loading_state.rs b/bevy_asset_loader/src/loading_state.rs index 10c8f46..ce95ee3 100644 --- a/bevy_asset_loader/src/loading_state.rs +++ b/bevy_asset_loader/src/loading_state.rs @@ -846,7 +846,7 @@ impl LoadingStateConfig { .world .get_resource_mut::>() .unwrap_or_else(|| { - panic!("Failed to get the DynamicAssetCollections resource for the loading state.") + panic!("Failed to get the DynamicAssetCollections resource for the loading state. Are you trying to configure a loading state before it was added to the bevy App?") }); for (id, files) in self.dynamic_assets.drain() { dynamic_assets.register_files_by_type_id(self.state.clone(), files, id);