fix scene_viewer example on wasm (#4426)

The scene viewer example doesn't run on wasm because it sets the asset folder to `std::env::var("CARGO_MANIFEST_DIR").unwrap()`, which isn't supported on the web.

Solution: set the asset folder to `"."` instead.
This commit is contained in:
Jakob Hellermann 2022-04-05 20:45:06 +00:00
parent 73edb11db6
commit 7e3637c36f

View file

@ -40,7 +40,7 @@ Controls:
brightness: 1.0 / 5.0f32,
})
.insert_resource(AssetServerSettings {
asset_folder: std::env::var("CARGO_MANIFEST_DIR").unwrap(),
asset_folder: std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string()),
watch_for_changes: true,
})
.insert_resource(WindowDescriptor {