1 unstable release
0.1.0 | Oct 13, 2022 |
---|
#327 in #ecs
16KB
63 lines
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
:
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
Dependencies
~19–35MB
~574K SLoC