Skip to content

Commit

Permalink
set asset path relative to root when loading sync (bevyengine#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf authored Oct 7, 2020
1 parent 6f287fb commit 52a4d49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_asset/src/asset_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 52a4d49

Please sign in to comment.