From 71a031c3f9bc315400696caf925bd0bc859582a6 Mon Sep 17 00:00:00 2001 From: Connor Date: Mon, 5 Jan 2026 03:23:32 +0000 Subject: [PATCH] unity components registration --- unity-parser/src/types/unity_types/box_collider.rs | 12 ++++++++++++ unity-parser/src/types/unity_types/mesh_filter.rs | 12 ++++++++++++ unity-parser/src/types/unity_types/mesh_renderer.rs | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/unity-parser/src/types/unity_types/box_collider.rs b/unity-parser/src/types/unity_types/box_collider.rs index 93d2c6b..341a1d2 100644 --- a/unity-parser/src/types/unity_types/box_collider.rs +++ b/unity-parser/src/types/unity_types/box_collider.rs @@ -52,3 +52,15 @@ impl crate::types::EcsInsertable for BoxCollider { world.insert(entity, (self,)); } } + +// Register component with inventory +inventory::submit! { + crate::types::ComponentRegistration { + type_id: 65, + class_name: "BoxCollider", + parse_and_insert: |yaml, ctx, world, entity| { + ::parse_and_insert(yaml, ctx, world, entity) + }, + register: |builder| builder.register::(), + } +} diff --git a/unity-parser/src/types/unity_types/mesh_filter.rs b/unity-parser/src/types/unity_types/mesh_filter.rs index c066a47..95b0d5b 100644 --- a/unity-parser/src/types/unity_types/mesh_filter.rs +++ b/unity-parser/src/types/unity_types/mesh_filter.rs @@ -40,3 +40,15 @@ impl crate::types::EcsInsertable for MeshFilter { world.insert(entity, (self,)); } } + +// Register component with inventory +inventory::submit! { + crate::types::ComponentRegistration { + type_id: 33, + class_name: "MeshFilter", + parse_and_insert: |yaml, ctx, world, entity| { + ::parse_and_insert(yaml, ctx, world, entity) + }, + register: |builder| builder.register::(), + } +} diff --git a/unity-parser/src/types/unity_types/mesh_renderer.rs b/unity-parser/src/types/unity_types/mesh_renderer.rs index 47318cc..79a610e 100644 --- a/unity-parser/src/types/unity_types/mesh_renderer.rs +++ b/unity-parser/src/types/unity_types/mesh_renderer.rs @@ -41,3 +41,15 @@ impl crate::types::EcsInsertable for MeshRenderer { world.insert(entity, (self,)); } } + +// Register component with inventory +inventory::submit! { + crate::types::ComponentRegistration { + type_id: 23, + class_name: "MeshRenderer", + parse_and_insert: |yaml, ctx, world, entity| { + ::parse_and_insert(yaml, ctx, world, entity) + }, + register: |builder| builder.register::(), + } +}