Skip to content

Commit

Permalink
Improve panic when configuring a loading state that is not yet added …
Browse files Browse the repository at this point in the history
…to the application
  • Loading branch information
NiklasEi committed Nov 26, 2023
1 parent 6a8f057 commit 738db4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bevy_asset_loader/src/loading_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ impl<S: States> LoadingStateConfig<S> {
.world
.get_resource_mut::<DynamicAssetCollections<S>>()
.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);
Expand Down

0 comments on commit 738db4a

Please sign in to comment.