mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Docs reflect that RemovalDetection
also yields despawned entities (#11795)
# Objective I want to keep track of despawned entities. I am aware of [`RemovedComponents`](https://docs.rs/bevy/0.12.1/bevy/ecs/prelude/struct.RemovedComponents.html). However, the docs don't explicitly mention that despawned entities are also included in this event iterator. I searched through the bevy tests to find `removal_tracking` in `crates/bevy_ecs/src/system/mod.rs` that confirmed the behavior: ```rust ... assert_eq!( removed_i32.read().collect::<Vec<_>>(), &[despawned.0], "despawning causes the correct entity to show up in the 'RemovedComponent' system parameter." ); ... ``` ## Solution - Explicitly mention this behavior in docs.
This commit is contained in:
parent
3af8526786
commit
00313912bb
1 changed files with 2 additions and 1 deletions
|
@ -99,7 +99,8 @@ impl RemovedComponentEvents {
|
|||
}
|
||||
}
|
||||
|
||||
/// A [`SystemParam`] that grants access to the entities that had their `T` [`Component`] removed.
|
||||
/// A [`SystemParam`] that yields entities that had their `T` [`Component`]
|
||||
/// removed or have been despawned with it.
|
||||
///
|
||||
/// This acts effectively the same as an [`EventReader`](crate::event::EventReader).
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue