use bevy hierarchy system

This commit is contained in:
TotallyNot 2025-11-03 18:54:07 +01:00
parent 35413b563c
commit cfe2631578
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
15 changed files with 246 additions and 643 deletions

View file

@ -1,6 +1,6 @@
use std::borrow::Cow;
use bevy_ecs::{entity::Entity, world::World};
use bevy_ecs::{prelude::*, relationship::RelatedSpawner};
use strum::Display;
use crate::{
@ -186,8 +186,8 @@ impl ArmourDto {
.collect()
}
pub fn spawn(self, world: &mut World) -> Entity {
let mut commands = world.spawn(draw_id());
pub fn spawn(self, spawner: &mut RelatedSpawner<'_, ChildOf>) -> Entity {
let mut commands = spawner.spawn(draw_id());
commands.insert((
Name(self.name.to_string()),