summaryrefslogtreecommitdiff
path: root/engine-ecs/src
diff options
context:
space:
mode:
Diffstat (limited to 'engine-ecs/src')
-rw-r--r--engine-ecs/src/entity.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/engine-ecs/src/entity.rs b/engine-ecs/src/entity.rs
index b9829e1..db59301 100644
--- a/engine-ecs/src/entity.rs
+++ b/engine-ecs/src/entity.rs
@@ -322,6 +322,16 @@ macro_rules! declare_entity {
$crate::entity::Declaration::new(|world| {
world.spawn_with_uid(*$ident, $components);
});
+ };
+
+ ($($(#[$attr: meta])* $visibility: vis $ident: ident: $components: expr;)+) => {
+ $(
+ $(#[$attr])*
+ $visibility static $ident: $crate::entity::Declaration =
+ $crate::entity::Declaration::new(|world| {
+ world.spawn_with_uid(*$ident, $components);
+ });
+ )+
}
}