From f8e9fc157a205451607ddff6975027b3573c3934 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 21 Jul 2026 16:17:12 +0200 Subject: feat(engine-ecs): automatically include entity name component in declared entities --- engine-ecs/src/entity.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engine-ecs/src/entity.rs') diff --git a/engine-ecs/src/entity.rs b/engine-ecs/src/entity.rs index 4e0ca52..ba85956 100644 --- a/engine-ecs/src/entity.rs +++ b/engine-ecs/src/entity.rs @@ -322,7 +322,14 @@ macro_rules! declare_entity { $(#[$attr])* $visibility static $ident: $crate::entity::Declaration = $crate::entity::Declaration::new(|world| { - world.spawn_with_uid(*$ident, $components); + use $crate::tuple::Tuple; + + world.spawn_with_uid( + *$ident, + ($components).with_elem($crate::entity::Name { + name: concat!(module_path!(), stringify!($ident)).into() + }) + ); }); )+ } -- cgit v1.2.3-18-g5258