Macro children

Source
macro_rules! children {
    [$($child:expr),*$(,)?] => { ... };
}
Expand description

Returns a SpawnRelatedBundle that will insert the Children component, spawn a SpawnableList of entities with given bundles that relate to the Children entity via the ChildOf component, and reserve space in the Children for each spawned entity.

Any additional arguments will be interpreted as bundles to be spawned.

Also see related for a version of this that works with any RelationshipTarget type.

let mut world = World::new();
world.spawn((
    Name::new("Root"),
    children![
        Name::new("Child1"),
        (
            Name::new("Child2"),
            children![Name::new("Grandchild")]
        )
    ]
));