From da5e0888496b00839f0ecc96fff177c784dfb4d6 Mon Sep 17 00:00:00 2001 From: TheRawMeatball Date: Tue, 5 Apr 2022 14:24:20 +0300 Subject: [PATCH] add method --- crates/bevy_ecs/src/system/commands/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 7d3f541dab930..562ff04b65e4a 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -48,6 +48,11 @@ impl<'w, 's> Commands<'w, 's> { } } + /// Create a new `Commands` from a queue and an [`Entities`] reference. + pub fn new_from_entities(queue: &'s mut CommandQueue, entities: &'w Entities) -> Self { + Self { queue, entities } + } + /// Creates a new empty [`Entity`] and returns an [`EntityCommands`] builder for it. /// /// To directly spawn an entity with a [`Bundle`] included, you can use