| Crates.io | bevy_despawn_tree |
| lib.rs | bevy_despawn_tree |
| version | 0.1.0 |
| created_at | 2022-10-13 09:27:45.309324+00 |
| updated_at | 2022-10-13 09:27:45.309324+00 |
| description | Despawn an entire parent-child entity hierarchy from any entity at any depth in the hierarchy. |
| homepage | |
| repository | https://github.com/ickshonpe/bevy_despawn_tree |
| max_upload_size | |
| id | 687069 |
| size | 57,073 |
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
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();
Spawns two marked trees, despawns one from a queried child without touching the other.
cargo run --example example