diff --git a/crates/bevy_ecs/src/system/commands.rs b/crates/bevy_ecs/src/system/commands.rs index 04e68b002d88d..90cab955f5e76 100644 --- a/crates/bevy_ecs/src/system/commands.rs +++ b/crates/bevy_ecs/src/system/commands.rs @@ -219,8 +219,11 @@ impl CommandsInternal { } pub fn write_world(&mut self, world_writer: W) -> &mut Self { - self.commands - .push(Command::WriteWorld(Box::new(world_writer))); + self.write_world_boxed(Box::new(world_writer)) + } + + pub fn write_world_boxed(&mut self, world_writer: Box) -> &mut Self { + self.commands.push(Command::WriteWorld(world_writer)); self } @@ -313,6 +316,11 @@ impl Commands { self } + pub fn write_world_boxed(&mut self, world_writer: Box) -> &mut Self { + self.commands.lock().write_world_boxed(world_writer); + self + } + pub fn write_resources( &mut self, resources_writer: W,