mirror of
https://github.com/bevyengine/bevy
synced 2025-01-08 19:29:04 +00:00
f9853cbbc2
# Objective - Fixes #5850 ## Solution - As described in the issue, added a `get_entity` method on `Commands` that returns an `Option<EntityCommands>` ## Changelog - Added the new method with a simple doc test - I have re-used `get_entity` in `entity`, similarly to how `get_single` is used in `single` while additionally preserving the error message - Add `#[inline]` to both functions Entities that have commands queued to despawn system will still return commands when `get_entity` is called but that is representative of the fact that the entity is still around until those commands are flushed. A potential `contains_entity` could also be added in this PR if desired, that would effectively be replacing Entities.contains but may be more discoverable if this is a common use case. Co-authored-by: Carter Anderson <mcanders1@gmail.com> |
||
---|---|---|
.. | ||
command_queue.rs | ||
mod.rs | ||
parallel_scope.rs |