Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing asset info path for synchronous loading #486

Merged
merged 1 commit into from
Sep 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/bevy_asset/src/asset_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,15 @@ impl AssetServer {
.to_str()
.expect("extension should be a valid string"),
) {
let mut asset_info_paths = self.asset_info_paths.write();
let handle_id = HandleId::new();
let resources = &self.loaders[*index];
let loader = resources.get::<Box<dyn AssetLoader<T>>>().unwrap();
let asset = loader.load_from_file(path)?;
let handle = Handle::from(handle_id);

assets.set(handle, asset);
asset_info_paths.insert(path.to_owned(), handle_id);
Ok(handle)
} else {
Err(AssetServerError::MissingAssetHandler)
Expand Down