Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-13T09:27:06.000Z (about 2 years ago)
- Last Synced: 2024-10-18T08:35:06.884Z (2 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
[![crates.io](https://img.shields.io/crates/v/bevy_despawn_tree)](https://crates.io/crates/bevy_despawn_tree)
[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/ickshonpe/bevy_despawn_tree)
[![crates.io](https://img.shields.io/crates/d/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
```