mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: passing args to component in entity definition
This commit is contained in:
parent
f2aa77db8b
commit
f6be6689aa
5 changed files with 33 additions and 7 deletions
|
|
@ -173,9 +173,9 @@ entityid_t Entities::spawn(
|
|||
auto& scripting = registry.emplace<ScriptComponents>(entity);
|
||||
registry.emplace<rigging::Skeleton>(entity, skeleton->instance());
|
||||
|
||||
for (auto& componentName : def.components) {
|
||||
for (auto& instance : def.components) {
|
||||
auto component = std::make_unique<UserComponent>(
|
||||
componentName, EntityFuncsSet {}, nullptr
|
||||
instance.component, EntityFuncsSet {}, nullptr, instance.params
|
||||
);
|
||||
scripting.components.emplace_back(std::move(component));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue