Skip to content

Commit

Permalink
Add warning when using load_folder on web (#5827)
Browse files Browse the repository at this point in the history
# Objective

Help users who are using `load_folder` in wasm builds to find a slightly shorter path to figuring out why their stuff is broken.

## Solution

Adds a warning to `read_directory` in the `WasmAssetIo`.

This is extremely similar to the warning already emitted a few lines below for `watch_for_changes`.
  • Loading branch information
rparrett committed Aug 29, 2022
1 parent f62bdc3 commit adf2475
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_asset/src/io/wasm_asset_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl AssetIo for WasmAssetIo {
&self,
_path: &Path,
) -> Result<Box<dyn Iterator<Item = PathBuf>>, AssetIoError> {
bevy_log::warn!("Loading folders is not supported in WASM");
Ok(Box::new(std::iter::empty::<PathBuf>()))
}

Expand Down

0 comments on commit adf2475

Please sign in to comment.