SceneSound.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. require "Polycode/Entity"
  2. class "SceneSound" (Entity)
  3. function SceneSound:SceneSound(...)
  4. local arg = {...}
  5. if type(arg[1]) == "table" and count(arg) == 1 then
  6. if ""..arg[1].__classname == "Entity" then
  7. self.__ptr = arg[1].__ptr
  8. return
  9. end
  10. end
  11. for k,v in pairs(arg) do
  12. if type(v) == "table" then
  13. if v.__ptr ~= nil then
  14. arg[k] = v.__ptr
  15. end
  16. end
  17. end
  18. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  19. self.__ptr = Polycore.SceneSound(unpack(arg))
  20. end
  21. end
  22. function SceneSound:Update()
  23. local retVal = Polycore.SceneSound_Update(self.__ptr)
  24. end
  25. function SceneSound:Clone(deepClone, ignoreEditorOnly)
  26. local retVal = Polycore.SceneSound_Clone(self.__ptr, deepClone, ignoreEditorOnly)
  27. if retVal == nil then return nil end
  28. local __c = _G["Entity"]("__skip_ptr__")
  29. __c.__ptr = retVal
  30. return __c
  31. end
  32. function SceneSound:applyClone(clone, deepClone, ignoreEditorOnly)
  33. local retVal = Polycore.SceneSound_applyClone(self.__ptr, clone.__ptr, deepClone, ignoreEditorOnly)
  34. end
  35. function SceneSound:isDirectionalSound()
  36. local retVal = Polycore.SceneSound_isDirectionalSound(self.__ptr)
  37. return retVal
  38. end
  39. function SceneSound:setDirectionalSound(val)
  40. local retVal = Polycore.SceneSound_setDirectionalSound(self.__ptr, val)
  41. end
  42. function SceneSound:getSound()
  43. local retVal = Polycore.SceneSound_getSound(self.__ptr)
  44. if retVal == nil then return nil end
  45. local __c = _G["Sound"]("__skip_ptr__")
  46. __c.__ptr = retVal
  47. return __c
  48. end
  49. function SceneSound:setLoopOnLoad(val)
  50. local retVal = Polycore.SceneSound_setLoopOnLoad(self.__ptr, val)
  51. end
  52. function SceneSound:getLoopOnLoad()
  53. local retVal = Polycore.SceneSound_getLoopOnLoad(self.__ptr)
  54. return retVal
  55. end
  56. function SceneSound:__delete()
  57. if self then Polycore.delete_SceneSound(self.__ptr) end
  58. end