bevy_despawn_tree
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
:
= "0.1.0"
Then to despawn the tree containing the entity leaf
:
use *;
commands.entity.despawn_tree;
Example
Spawns two marked trees, despawns one from a queried child without touching the other.
cargo run --example example