unity components registration
This commit is contained in:
@@ -52,3 +52,15 @@ impl crate::types::EcsInsertable for BoxCollider {
|
|||||||
world.insert(entity, (self,));
|
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| {
|
||||||
|
<BoxCollider as crate::types::EcsInsertable>::parse_and_insert(yaml, ctx, world, entity)
|
||||||
|
},
|
||||||
|
register: |builder| builder.register::<BoxCollider>(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,3 +40,15 @@ impl crate::types::EcsInsertable for MeshFilter {
|
|||||||
world.insert(entity, (self,));
|
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| {
|
||||||
|
<MeshFilter as crate::types::EcsInsertable>::parse_and_insert(yaml, ctx, world, entity)
|
||||||
|
},
|
||||||
|
register: |builder| builder.register::<MeshFilter>(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,3 +41,15 @@ impl crate::types::EcsInsertable for MeshRenderer {
|
|||||||
world.insert(entity, (self,));
|
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| {
|
||||||
|
<MeshRenderer as crate::types::EcsInsertable>::parse_and_insert(yaml, ctx, world, entity)
|
||||||
|
},
|
||||||
|
register: |builder| builder.register::<MeshRenderer>(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user