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

Load assets from root path when loading directly #478

Merged
merged 1 commit into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [iOS: use shaderc-rs for glsl to spirv compilation][324]
- [Changed the default node size to Auto instead of Undefined to match the Stretch implementation.][304]
- Many improvements to Bevy's CI [#325][325], [#349][349], [#357][357], [#373][373], [#423][423]
- [Load assets from root path when loading directly][478]

### Fixed

Expand Down Expand Up @@ -83,6 +84,7 @@
[423]: https://github.com/bevyengine/bevy/pull/423
[428]: https://github.com/bevyengine/bevy/pull/428
[433]: https://github.com/bevyengine/bevy/pull/433
[478]: https://github.com/bevyengine/bevy/pull/478


## Version 0.1.3 (2020-8-22)
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_asset/src/asset_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ impl AssetServer {

// TODO: add type checking here. people shouldn't be able to request a Handle<Texture> for a Mesh asset
pub fn load<T, P: AsRef<Path>>(&self, path: P) -> Result<Handle<T>, AssetServerError> {
self.load_untyped(path).map(Handle::from)
self.load_untyped(self.get_root_path()?.join(path))
.map(Handle::from)
}

pub fn load_sync<T: Resource, P: AsRef<Path>>(
Expand Down