use bevy hierarchy system
This commit is contained in:
parent
35413b563c
commit
cfe2631578
15 changed files with 246 additions and 643 deletions
|
|
@ -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()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue