bevy_despawn_tree

Crates.iobevy_despawn_tree
lib.rsbevy_despawn_tree
version0.1.0
sourcesrc
created_at2022-10-13 09:27:45.309324
updated_at2022-10-13 09:27:45.309324
descriptionDespawn an entire parent-child entity hierarchy from any entity at any depth in the hierarchy.
homepage
repositoryhttps://github.com/ickshonpe/bevy_despawn_tree
max_upload_size
id687069
size57,073
(ickshonpe)

documentation

README

bevy_despawn_tree

crates.io MIT/Apache 2.0 crates.io

An extension method for Bevy's EntityCommands that despawns an entire parent-child entity hierarchy tree from an EntityCommands for any entity at any depth in the hierarchy.

Supports Bevy 0.8

Usage

Add the dependency to your project's Cargo.toml:

bevy_despawn_tree = "0.1.0"

Then to despawn the tree containing the entity leaf:

use bevy_despawn_tree::*;

commands.entity(leaf).despawn_tree();

Example

Spawns two marked trees, despawns one from a queried child without touching the other.

cargo run --example example
Commit count: 2

cargo fmt