Skip to main content

restore_scene

Function restore_scene 

Source
pub fn restore_scene(world: &mut GameWorld, snapshot: &[u8])
Expand description

Restores the world from a snapshot produced by snapshot_scene.

Despawns every existing entity before deserializing — the live world after gameplay may have spawned new entities or destroyed old ones, so we rebuild from the snapshot rather than diff against it.