Added prefab instancing through C# and support for mid-game rigidbody and skeletal animation

This commit is contained in:
Antoine Pilote
2024-04-23 23:22:19 -04:00
parent f854a2d783
commit 39025d8b06
7 changed files with 173 additions and 62 deletions

View File

@@ -75,6 +75,17 @@ namespace Nuake {
}
}
int InstancePrefab(Coral::String path)
{
if (!FileSystem::FileExists(path))
{
return -1;
}
const auto& prefab = Prefab::New(path);
return prefab->Root.GetHandle();
}
static enum ComponentTypes
{
Unknown = -1,
@@ -291,11 +302,12 @@ namespace Nuake {
RegisterMethod("Entity.EntityHasComponentIcall", &EntityHasComponent);
RegisterMethod("Entity.EntityHasManagedInstanceIcall", &EntityHasManagedInstance);
RegisterMethod("Entity.EntityGetEntityIcall", &EntityGetEntity);
// Scene
RegisterMethod("Scene.GetEntityIcall", &GetEntity);
RegisterMethod("Scene.GetEntityScriptFromNameIcall", &GetEntityScriptFromName);
RegisterMethod("Scene.GetEntityScriptFromHandleIcall", &GetEntityScriptFromHandle);
RegisterMethod("Scene.InstancePrefabIcall", &InstancePrefab);
// Components
RegisterMethod("TransformComponent.SetPositionIcall", &TransformSetPosition);
RegisterMethod("TransformComponent.GetPositionIcall", &TransformGetPosition);