Skip to content

Commit

Permalink
remove pub from despawn_with_children_recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Mar 5, 2022
1 parent 397b5ba commit 25848a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/bevy_transform/src/hierarchy/hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ use bevy_utils::tracing::debug;
/// Despawns the given entity and all its children recursively
#[derive(Debug)]
pub struct DespawnRecursive {
entity: Entity,
/// Target entity
pub entity: Entity,
}

/// Despawns the given entity's children recursively
#[derive(Debug)]
pub struct DespawnChildrenRecursive {
entity: Entity,
/// Target entity
pub entity: Entity,
}

/// Function for despawning an entity and all its children
pub fn despawn_with_children_recursive(world: &mut World, entity: Entity) {
fn despawn_with_children_recursive(world: &mut World, entity: Entity) {
// first, make the entity's own parent forget about it
if let Some(parent) = world.get::<Parent>(entity).map(|parent| parent.0) {
if let Some(mut children) = world.get_mut::<Children>(parent) {
Expand Down

0 comments on commit 25848a1

Please sign in to comment.