mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
Use run condition for scene downloader
This commit is contained in:
@@ -44,7 +44,9 @@ impl Plugin for ScenePlugin {
|
||||
PostUpdate,
|
||||
(
|
||||
wasm::notify_entity_spawn_changes.pipe(error),
|
||||
wasm::save_scene_system.pipe(error),
|
||||
wasm::save_scene_system
|
||||
.pipe(error)
|
||||
.run_if(wasm::scene_download_requested),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ pub fn save_scene() {
|
||||
wasm::write_message!(SCENE_REQUEST, ());
|
||||
}
|
||||
|
||||
pub(super) fn save_scene_system(world: &mut World) -> Result<(), String> {
|
||||
if wasm::read_buffer!(SCENE_REQUEST).is_none() {
|
||||
return Ok(());
|
||||
}
|
||||
pub(super) fn scene_download_requested() -> bool {
|
||||
wasm::read_buffer!(SCENE_REQUEST).is_some()
|
||||
}
|
||||
|
||||
pub(super) fn save_scene_system(world: &mut World) -> Result<(), String> {
|
||||
let mut scene = DynamicScene::from_world(world);
|
||||
let type_registry = world.resource::<AppTypeRegistry>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user