mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
set asset path relative to root when loading sync (#643)
This commit is contained in:
parent
6f287fb815
commit
52a4d49bbf
1 changed files with 2 additions and 2 deletions
|
@ -205,7 +205,7 @@ impl AssetServer {
|
|||
where
|
||||
T: 'static,
|
||||
{
|
||||
let path = path.as_ref();
|
||||
let path = self.get_root_path()?.join(path);
|
||||
if let Some(ref extension) = path.extension() {
|
||||
if let Some(index) = self.extension_to_loader_index.get(
|
||||
extension
|
||||
|
@ -216,7 +216,7 @@ impl AssetServer {
|
|||
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 asset = loader.load_from_file(path.as_ref())?;
|
||||
let handle = Handle::from(handle_id);
|
||||
|
||||
assets.set(handle, asset);
|
||||
|
|
Loading…
Reference in a new issue