Skip to content

Commit

Permalink
fix scene_viewer example on wasm (bevyengine#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 authored and aevyrie committed Jun 7, 2022
1 parent c95048a commit 557c54b
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 557c54b

Please sign in to comment.