Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/bevy_plugin/src/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::prelude::*;
use crate::project::{LoadYarnProjectEvent, WatchingForChanges};
#[cfg(not(target_arch = "wasm32"))]
use bevy::asset::io::file::FileAssetReader;
use bevy::prelude::*;
use std::path::PathBuf;
pub use yarn_file_source::YarnFileSource;
Expand Down Expand Up @@ -247,7 +249,12 @@ impl YarnApp for App {
fn register_asset_root(&mut self) -> &mut Self {
let asset_plugin = get_asset_plugin(self);
let path_str = asset_plugin.file_path.clone();

#[cfg(not(target_arch = "wasm32"))]
let path = FileAssetReader::get_base_path().join(path_str);
#[cfg(target_arch = "wasm32")]
let path = PathBuf::from(path_str);

self.insert_resource(AssetRoot(path))
}
}
Expand Down