mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-26 08:38:10 +00:00
Nesting
This commit is contained in:
@@ -18,7 +18,10 @@ pub fn save_scene() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn save_scene_system(world: &mut World) -> Result<(), String> {
|
pub(super) fn save_scene_system(world: &mut World) -> Result<(), String> {
|
||||||
wasm::read_buffer!(SCENE_REQUEST, |_| {
|
if wasm::read_buffer!(SCENE_REQUEST).is_none() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
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>();
|
||||||
|
|
||||||
@@ -67,10 +70,7 @@ pub(super) fn save_scene_system(world: &mut World) -> Result<(), String> {
|
|||||||
})
|
})
|
||||||
.ok_or_else(|| "Failed to get Window from &mut World".to_string())?;
|
.ok_or_else(|| "Failed to get Window from &mut World".to_string())?;
|
||||||
|
|
||||||
wasm::dispatch_to_js(window, "scene-download-ready", &serialized)?;
|
wasm::dispatch_to_js(window, "scene-download-ready", &serialized)
|
||||||
});
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen(typescript_custom_section)]
|
#[wasm_bindgen(typescript_custom_section)]
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ macro_rules! read_buffer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
|
($buffer:ident) => {{
|
||||||
|
let buffer = crate::wasm::get_buffer!($buffer);
|
||||||
|
buffer.try_lock().and_then(|lock| lock.borrow_mut().take())
|
||||||
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) use get_buffer;
|
pub(crate) use get_buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user