UIPopGotSingleCtr.lua 898 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. local UIPopGotSingleCtr = class("UIPopGotSingleCtr", require("UICtrBase"))
  2. function UIPopGotSingleCtr:Init(view)
  3. self.view = view
  4. end
  5. ---@param data table {id=integer, startPos=Vector3} id:StorySectionCfg的Id, startPos世界坐标
  6. function UIPopGotSingleCtr:SetData(data)
  7. self.asyncIdx = 0
  8. if data == nil then return end
  9. self.data = data
  10. self:InitData()
  11. end
  12. function UIPopGotSingleCtr:GetAsyncIdx()
  13. self.asyncIdx = self.asyncIdx + 1
  14. return self.asyncIdx
  15. end
  16. function UIPopGotSingleCtr:GetData()
  17. return self.data
  18. end
  19. function UIPopGotSingleCtr:OnDispose()
  20. self.data = nil
  21. self.view = nil
  22. end
  23. function UIPopGotSingleCtr:InitData()
  24. self.storySectionId = self.data.id
  25. self.startPos = self.data.startPos
  26. end
  27. function UIPopGotSingleCtr:GetStorySectionId()
  28. return self.storySectionId
  29. end
  30. function UIPopGotSingleCtr:GetStartPos()
  31. return self.startPos
  32. end
  33. return UIPopGotSingleCtr