From adf2475dabdb3095ed8dc30f68b8bcf4c5f2949c Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Mon, 29 Aug 2022 22:26:43 +0000 Subject: [PATCH] Add warning when using load_folder on web (#5827) # 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`. --- crates/bevy_asset/src/io/wasm_asset_io.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_asset/src/io/wasm_asset_io.rs b/crates/bevy_asset/src/io/wasm_asset_io.rs index c4ecae76cf..1cf8d3b271 100644 --- a/crates/bevy_asset/src/io/wasm_asset_io.rs +++ b/crates/bevy_asset/src/io/wasm_asset_io.rs @@ -52,6 +52,7 @@ impl AssetIo for WasmAssetIo { &self, _path: &Path, ) -> Result>, AssetIoError> { + bevy_log::warn!("Loading folders is not supported in WASM"); Ok(Box::new(std::iter::empty::())) }