Added new Prefab C# type

This commit is contained in:
Antoine Pilote
2024-08-15 22:24:26 -04:00
parent 04926476d7
commit 58a179be4f
8 changed files with 181 additions and 14 deletions

View File

@@ -122,7 +122,7 @@ namespace Nuake
}
}
Entity currentEntity;
Entity currentEntity = Entity({(entt::entity)-1, this});
uint32_t currentSplitIndex = 1;
while (currentSplitIndex < splits.size())
{
@@ -145,6 +145,12 @@ namespace Nuake
}
}
// Not found
if (!currentEntity.IsValid())
{
return Entity({(entt::entity)-1, this});
}
// Then look through child of root entity
for (auto& child : currentEntity.GetComponent<ParentComponent>().Children)
{
@@ -571,11 +577,7 @@ namespace Nuake
auto entity = Entity{ e, this };
auto parentEntity = GetEntityByID(parentComponent.ParentID);
if (entity.IsValid())
{
parentEntity.AddChild(entity);
}
parentEntity.AddChild(entity);
}
// This will turn the deserialized entity ids into actual Entities.