@@ -467,7 +467,31 @@ void LuaBinding::registerCoreClasses(lua_State *L){
467467 .endClass ();
468468
469469 luabridge::getGlobalNamespace (L)
470- .beginClass <Scene>(" Scene" )
470+ .beginClass <EntityRegistry>(" EntityRegistry" )
471+ .addConstructor <void (*) (void )> ()
472+ .addFunction (" createEntity" , &EntityRegistry::createEntity)
473+ // .addFunction("recreateEntity", &EntityRegistry::recreateEntity)
474+ .addFunction (" isEntityCreated" , &EntityRegistry::isEntityCreated)
475+ .addFunction (" destroyEntity" , &EntityRegistry::destroyEntity)
476+ .addFunction (" addEntityChild" , &EntityRegistry::addEntityChild)
477+ // .addFunction("moveChildToIndex", &EntityRegistry::moveChildToIndex)
478+ .addFunction (" moveChildToTop" , &EntityRegistry::moveChildToTop)
479+ .addFunction (" moveChildUp" , &EntityRegistry::moveChildUp)
480+ .addFunction (" moveChildDown" , &EntityRegistry::moveChildDown)
481+ .addFunction (" moveChildToBottom" , &EntityRegistry::moveChildToBottom)
482+ .addFunction (" getSignature" , &EntityRegistry::getSignature)
483+ .addFunction (" getEntityName" , &EntityRegistry::getEntityName)
484+ .addFunction (" setEntityName" , &EntityRegistry::setEntityName)
485+ .addFunction (" findOldestParent" , &EntityRegistry::findOldestParent)
486+ .addFunction (" isParentOf" , &EntityRegistry::isParentOf)
487+ .addFunction (" findBranchLastIndex" , &EntityRegistry::findBranchLastIndex)
488+ .addFunction (" getLastEntity" , &EntityRegistry::getLastEntity)
489+ .addFunction (" getEntityList" , &EntityRegistry::getEntityList)
490+ .addFunction (" clear" , &EntityRegistry::clear)
491+ .endClass ();
492+
493+ luabridge::getGlobalNamespace (L)
494+ .deriveClass <Scene, EntityRegistry>(" Scene" )
471495 .addConstructor <void (*) (void )> ()
472496 .addFunction (" load" , &Scene::load)
473497 .addFunction (" destroy" , &Scene::destroy)
@@ -489,19 +513,6 @@ void LuaBinding::registerCoreClasses(lua_State *L){
489513 .addFunction (" setGlobalIllumination" , (void (Scene::*)(float , Vector3))&Scene::setGlobalIllumination)
490514 .addFunction (" canReceiveUIEvents" , &Scene::canReceiveUIEvents)
491515 .addProperty (" enableUIEvents" , &Scene::isEnableUIEvents, &Scene::setEnableUIEvents)
492- .addFunction (" findOldestParent" , &Scene::findOldestParent)
493- .addFunction (" isParentOf" , &Scene::isParentOf)
494- .addFunction (" findBranchLastIndex" , &Scene::findBranchLastIndex)
495- .addFunction (" createEntity" , &Scene::createEntity)
496- .addFunction (" destroyEntity" , &Scene::destroyEntity)
497- .addFunction (" addEntityChild" , &Scene::addEntityChild)
498- .addFunction (" moveChildToTop" , &Scene::moveChildToTop)
499- .addFunction (" moveChildUp" , &Scene::moveChildUp)
500- .addFunction (" moveChildDown" , &Scene::moveChildDown)
501- .addFunction (" moveChildToBottom" , &Scene::moveChildToBottom)
502- .addFunction (" getSignature" , &Scene::getSignature)
503- .addFunction (" getEntityName" , &Scene::getEntityName)
504- .addFunction (" setEntityName" , &Scene::setEntityName)
505516 .addFunction (" getActionSystem" , [] (Scene* self, lua_State* L) { return self->getSystem <ActionSystem>().get (); })
506517 .addFunction (" getAudioSystem" , [] (Scene* self, lua_State* L) { return self->getSystem <AudioSystem>().get (); })
507518 .addFunction (" getMeshSystem" , [] (Scene* self, lua_State* L) { return self->getSystem <MeshSystem>().get (); })
0 commit comments