Skip to content

Commit

Permalink
fix scene_viewer example on wasm (#4426)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jakobhellermann committed Apr 5, 2022
1 parent 73edb11 commit 7e3637c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/tools/scene_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7e3637c

Please sign in to comment.