mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 22:18:33 +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()
|
.to_str()
|
||||||
.expect("extension should be a valid string"),
|
.expect("extension should be a valid string"),
|
||||||
) {
|
) {
|
||||||
|
let mut asset_info_paths = self.asset_info_paths.write();
|
||||||
let handle_id = HandleId::new();
|
let handle_id = HandleId::new();
|
||||||
let resources = &self.loaders[*index];
|
let resources = &self.loaders[*index];
|
||||||
let loader = resources.get::<Box<dyn AssetLoader<T>>>().unwrap();
|
let loader = resources.get::<Box<dyn AssetLoader<T>>>().unwrap();
|
||||||
let asset = loader.load_from_file(path)?;
|
let asset = loader.load_from_file(path)?;
|
||||||
let handle = Handle::from(handle_id);
|
let handle = Handle::from(handle_id);
|
||||||
|
|
||||||
assets.set(handle, asset);
|
assets.set(handle, asset);
|
||||||
|
asset_info_paths.insert(path.to_owned(), handle_id);
|
||||||
Ok(handle)
|
Ok(handle)
|
||||||
} else {
|
} else {
|
||||||
Err(AssetServerError::MissingAssetHandler)
|
Err(AssetServerError::MissingAssetHandler)
|
||||||
|
|
Loading…
Add table
Reference in a new issue