CoreMotionEvent.lua 756 B

1234567891011121314151617181920212223242526272829303132
  1. require "Polycode/Event"
  2. class "CoreMotionEvent" (Event)
  3. function CoreMotionEvent:__getvar(name)
  4. if name == "amount" then
  5. local retVal = Polycode.CoreMotionEvent_get_amount(self.__ptr)
  6. if retVal == nil then return nil end
  7. local __c = _G["Vector3"]("__skip_ptr__")
  8. __c.__ptr = retVal
  9. return __c
  10. end
  11. if Event["__getvar"] ~= nil then
  12. return Event.__getvar(self, name)
  13. end
  14. end
  15. function CoreMotionEvent:__setvar(name,value)
  16. if name == "amount" then
  17. Polycode.CoreMotionEvent_set_amount(self.__ptr, value.__ptr)
  18. return true
  19. end
  20. if Event["__setvar"] ~= nil then
  21. return Event.__setvar(self, name, value)
  22. else
  23. return false
  24. end
  25. end
  26. function CoreMotionEvent:__delete()
  27. if self then Polycode.delete_CoreMotionEvent(self.__ptr) end
  28. end