Fixed prefabs and prefab instancing

This commit is contained in:
Antoine Pilote
2023-08-09 00:30:38 -04:00
parent 67b8ca50fd
commit 67577b902b
5 changed files with 53 additions and 39 deletions

View File

@@ -107,11 +107,8 @@ namespace Nuake
return;
}
Entity& newEntity = Engine::GetCurrentScene()->CreateEntity(prefabName);
auto& prefabComponent = newEntity.AddComponent<PrefabComponent>();
prefabComponent.PrefabInstance = Prefab::New(prefabPath);
wrenSetSlotDouble(vm, 0, newEntity.GetHandle());
const auto& prefab = Prefab::New(prefabPath);
wrenSetSlotDouble(vm, 0, prefab->Root.GetHandle());
}
static void EntityHasComponent(WrenVM* vm)