bevy/crates
Sigma-dev 8cd53162bf
Add a despawn_children method to EntityWorldMut and EntityCommands (#19283)
# Objective

At the moment, if someone wants to despawn all the children of an
entity, they would need to use `despawn_related::<Children>();`.
In my opinion, this makes a very common operation less easily
discoverable and require some understanding of Entity Relationships.

## Solution

Adding a `despawn_children ` makes a very simple, discoverable and
readable way to despawn all the children while maintaining cohesion with
other similar methods.

## Testing

The implementation itself is very simple as it simply wraps around
`despawn_related` with `Children` as the generic type.
I gave it a quick try by modifying the parenting example and it worked
as expected.

---------

Co-authored-by: Zachary Harrold <zac@harrold.com.au>
2025-06-09 19:31:40 +00:00
..
bevy_a11y bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_animation Improve Bevy's double-precision story for third-party crates (#19194) 2025-06-08 02:02:47 +00:00
bevy_anti_aliasing bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_app generic component propagation (#17575) 2025-06-06 00:02:02 +00:00
bevy_asset bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_audio bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_color Improve Bevy's double-precision story for third-party crates (#19194) 2025-06-08 02:02:47 +00:00
bevy_core_pipeline bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_derive bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_dev_tools bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_diagnostic bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_dylib bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_ecs Add a despawn_children method to EntityWorldMut and EntityCommands (#19283) 2025-06-09 19:31:40 +00:00
bevy_encase_derive bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_gilrs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_gizmos bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_gltf bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_image bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_input bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_input_focus bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_internal bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_log bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_macro_utils bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_math Improve Bevy's double-precision story for third-party crates (#19194) 2025-06-08 02:02:47 +00:00
bevy_mesh bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_mikktspace bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_pbr bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_picking Fix PickingInteraction change detection (#19488) 2025-06-08 16:29:13 +00:00
bevy_platform bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_ptr bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_reflect bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_remote Only get valid component ids (#19510) 2025-06-06 20:59:57 +00:00
bevy_render Require naga_oil 0.17.1 (#19550) 2025-06-09 04:54:29 +00:00
bevy_scene Only get valid component ids (#19510) 2025-06-06 20:59:57 +00:00
bevy_sprite bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_state bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_tasks bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_text Remove re-exports of cosmic_text types (#19516) 2025-06-06 21:49:02 +00:00
bevy_time bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_transform bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_ui Specialized UI transform (#16615) 2025-06-09 19:05:49 +00:00
bevy_utils bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_window bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
bevy_winit bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00