mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
Fix missing asset info path for synchronous loading (#486)
This commit is contained in:
parent
b0e64d4295
commit
b3e339e58a
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue