SceneManager.lua 837 B

123456789101112131415161718192021222324252627282930313233343536
  1. class "SceneManager"
  2. function SceneManager:SceneManager(...)
  3. local arg = {...}
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycode.SceneManager(unpack(arg))
  13. end
  14. end
  15. function SceneManager:Update()
  16. local retVal = Polycode.SceneManager_Update(self.__ptr)
  17. end
  18. function SceneManager:fixedUpdate()
  19. local retVal = Polycode.SceneManager_fixedUpdate(self.__ptr)
  20. end
  21. function SceneManager:Render(viewport)
  22. local retVal = Polycode.SceneManager_Render(self.__ptr, viewport.__ptr)
  23. end
  24. function SceneManager:renderVirtual()
  25. local retVal = Polycode.SceneManager_renderVirtual(self.__ptr)
  26. end
  27. function SceneManager:__delete()
  28. if self then Polycode.delete_SceneManager(self.__ptr) end
  29. end