separated / src /components /childof.rs
k4d3's picture
awoo
48ca417
raw
history blame contribute delete
No virus
435 Bytes
use bevy::prelude::*;
use aery::prelude::*;
use super::name::Name;
#[derive(Relation)]
pub struct ChildOf;
pub fn debug_children(
tree: Query<(&Name, Relations<ChildOf>)>,
roots: Query<Entity, Root<ChildOf>>
) {
tree.traverse::<ChildOf>(roots.iter())
.track_self()
.for_each(|Name(parent), _, Name(child), _| {
debug!("{} is the parent of {}", parent, child);
});
}