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