-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled
Description
Bevy version
main (0.12), just after PR #9885 is committed
What you did
I have 2 sources, registered as follow
app.register_asset_source(
AssetSourceId::Default,
AssetSource::build().with_reader(|| Box::new(FileAssetReader::new(ASSET_PATH))),
);
app.register_asset_source(
AssetSourceId::Name("packfile".into()),
AssetSource::build().with_reader(|| Box::new(PackFileReader::new(ASSET_PATH))),
);
When I try to load a folder in the setup system.
fn setup(mut commands: Commands, assets: Res<AssetServer>) {
commands.insert_resource(Handles {
global_assets: assets.load_folder("packfile://global_assets.pak"),
});
}
What went wrong
My PackFileReader considers pack files as a directory and starts reading the "directory" with read_directory and returns 1 file which is attempted to be loaded, eventually reaching this function
bevy/crates/bevy_asset/src/server/mod.rs
Line 676 in 35073cf
| let source = self.get_source(asset_path.source())?; |
global_assets.pak/internal_file.bmp and has lost the packfile:// and the source/reader resolves to the default one, not the packfile.
Additional information
Most of the AssetReader functions use Path and PathBuf instead of AssetPath, so it is easy to lose the source info
Metadata
Metadata
Assignees
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled