https://github.com/ickshonpe/bevy_despawn_tree
Despawn an entire parent-child entity hierarchy from any entity at any depth in the hierarchy.
https://github.com/ickshonpe/bevy_despawn_tree
Last synced: 5 months ago
JSON representation
Despawn an entire parent-child entity hierarchy from any entity at any depth in the hierarchy.
- Host: GitHub
- URL: https://github.com/ickshonpe/bevy_despawn_tree
- Owner: ickshonpe
- Created: 2022-10-13T09:24:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-13T09:27:06.000Z (almost 3 years ago)
- Last Synced: 2025-01-05T11:42:11.942Z (6 months ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bevy_despawn_tree
[](https://crates.io/crates/bevy_despawn_tree)
[](https://github.com/ickshonpe/bevy_despawn_tree)
[](https://crates.io/crates/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`:
```toml
bevy_despawn_tree = "0.1.0"
```Then to despawn the tree containing the entity `leaf`:
```rust
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
```