UIGuildDemonView.lua 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. local UIGuildDemonView = require("UIGuild/UIGuildDemonView_Generate")
  2. local PreviewSystem = require("PreviewSystem")
  3. local RankList = {}
  4. local LoadStatusLoopListCtr = require('Common/LoadStatusLoopListCtr')
  5. function UIGuildDemonView:OnAwake(data)
  6. self.controller = require("UIGuild/UIGuildDemonCtr"):new()
  7. self.controller:Init(self)
  8. self.controller:SetData(data)
  9. end
  10. function UIGuildDemonView:AddEventListener()
  11. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  12. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.REFRESH_DEMON_PLAYER_RANK_INFO, self, self.RefreshPlayerInfo)
  13. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.REFRESH_DEMON_VIEW_INFO, self, self.Refresh)
  14. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.REFRESH_DEMON_FIGHT_VIEW_INFO, self, self.RefreshFightCountUI)
  15. end
  16. function UIGuildDemonView:FillContent(data, uiBase)
  17. self.uiBase = uiBase
  18. local gameObject = self.uiBase:GetRoot()
  19. if gameObject ~= nil then
  20. self.gameObject = gameObject
  21. self.transform = gameObject.transform
  22. end
  23. self:InitGenerate(self.transform, data)
  24. self:Init()
  25. end
  26. function UIGuildDemonView:Init()
  27. ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.RED_POINT_MGR_NOTICE, Enum.RPNotifyType.GuildDemonBoss, false)
  28. ManagerContainer.DataMgr.GuildDemonData:SendGuildDemonInfoReq()
  29. self:InitGrid()
  30. self.btnChallenge.button.interactable = false
  31. self:StartRefreshTimer()
  32. end
  33. function UIGuildDemonView:Refresh()
  34. if not self.previewSystem then
  35. self.previewSystem = PreviewSystem:new('GuildDemonPreview')
  36. self.previewSystem:SetView(Vector3(0, 1.93, 4.75), Quaternion.Euler(0, 180, 0))
  37. else
  38. self.previewSystem:RemoveAllGo()
  39. end
  40. self.bossImg.rawImage.texture = self.previewSystem:GetRenderTexture()
  41. self:RefreshModel()
  42. self:RefreshUIData()
  43. end
  44. function UIGuildDemonView:OnClickOtherHeadBtn(button,params)
  45. local uid = params[0]
  46. local selfUid = ManagerContainer.DataMgr.UserData:GetUserId()
  47. if selfUid == uid then
  48. ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("ChatError1")
  49. return
  50. end
  51. ManagerContainer.LuaUIMgr:OpenRoleMessagePanel(uid)
  52. end
  53. function UIGuildDemonView:RemoveEventListener()
  54. ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
  55. end
  56. function UIGuildDemonView:StartRefreshTimer()
  57. local timer = self.refreshTimer
  58. if not timer then
  59. timer = Timer.New(slot(self.RefreshTimer,self), 1, -1)
  60. self.refreshTimer = timer
  61. end
  62. if not timer.running then
  63. timer:Start()
  64. end
  65. end
  66. function UIGuildDemonView:StopRefreshTimer()
  67. if self.refreshTimer then
  68. self.refreshTimer:Stop()
  69. end
  70. end
  71. function UIGuildDemonView:DisposeRefreshTimer()
  72. self:StopRefreshTimer()
  73. self.refreshTimer = nil
  74. end
  75. function UIGuildDemonView:RefreshTimer()
  76. local fightTime = ManagerContainer.DataMgr.GuildDemonData:GetBossEndTime()
  77. local remainTime = nil
  78. if fightTime and fightTime > 0 then
  79. remainTime = ManagerContainer.LuaTimerMgr:GetRemainSecondsWithUInt64(fightTime)
  80. if remainTime > 0 then
  81. self.timeTxt.text.text = I18N.SetLanguageValue('OutTime1', DateTimeUtil.convertSeconds2TimeStr1(remainTime, true, true, false))
  82. else
  83. self.timeTxt.text.text = I18N.SetLanguageValue("GuildDemonLeave")
  84. end
  85. else
  86. self.timeTxt.text.text = I18N.SetLanguageValue("GuildDemonLeave")
  87. end
  88. local fightCount = ManagerContainer.DataMgr.GuildDemonData:GetfightCount()
  89. self.btnChallenge.button.interactable = remainTime and remainTime > 0 and fightCount > 0
  90. if not remainTime or remainTime <= 0 then
  91. self:StopRefreshTimer()
  92. else
  93. if self.refreshTimer then
  94. local validTime = nil
  95. if remainTime >= 86400 then
  96. validTime = remainTime % 3600
  97. if validTime == 0 then validTime = 3600 end
  98. elseif remainTime >= 3600 then
  99. validTime = remainTime % 60
  100. if validTime == 0 then validTime = 60 end
  101. else
  102. validTime = 1
  103. end
  104. if validTime then
  105. self.refreshTimer.duration = validTime
  106. else
  107. self:StopRefreshTimer()
  108. end
  109. end
  110. end
  111. end
  112. function UIGuildDemonView:InitGrid()
  113. if self.loadStatusLoopListCtr then
  114. self.loadStatusLoopListCtr:Dispose()
  115. self.loadStatusLoopListCtr = nil
  116. end
  117. self.loadStatusLoopListCtr = LoadStatusLoopListCtr:new(self, self.dmgRank.loopListView, 0, 50,
  118. false, nil, nil,
  119. true, 'LoadingItem', Enum.ListLoadingStatus.WaitLoad,
  120. self.GetItemByIndex, nil, self.OnBeginLoad)
  121. self.dmgRank.scrollRect.enabled = false
  122. self:InitData()
  123. end
  124. function UIGuildDemonView:OnBeginLoad(isLeft)
  125. -- 发送获得后续公会玩家信息
  126. local uids = ManagerContainer.DataMgr.GuildDemonData:GetPlayerUids()
  127. ManagerContainer.DataMgr.GuildDemonData:SendGetGuildMemberInfoReq(Enum.FriendTogglePageType.GuildDemonPlayerInfo,uids)
  128. end
  129. function UIGuildDemonView:RefreshPlayerInfo()
  130. RankList = ManagerContainer.DataMgr.GuildDemonData:GetMyGuildRankList()
  131. if not RankList then
  132. self.loadStatusLoopListCtr:OnAllLoaded()
  133. self.loadStatusLoopListCtr:RefreshMaxDataLength(0)
  134. self.loadStatusLoopListCtr:RefreshDataLength(0)
  135. return
  136. end
  137. local maxLength = ManagerContainer.DataMgr.GuildDemonData:GetPlayerInfoLimit()
  138. local dataLength = ManagerContainer.DataMgr.GuildDemonData:GetPlayerInfosLength()
  139. self.loadStatusLoopListCtr:OnAllLoaded()
  140. self.loadStatusLoopListCtr:RefreshMaxDataLength(maxLength)
  141. self.loadStatusLoopListCtr:RefreshDataLength(dataLength)
  142. end
  143. function UIGuildDemonView:GetItemByIndex(gridView,idx,itemIndex)
  144. local item = nil
  145. item = gridView:NewListViewItem('DmgRankItem')
  146. local showData = RankList[itemIndex + 1]
  147. local itemLua = CommonUtil.BindGridViewItem2Lua(self, 'DmgRankItem', item.gameObject)
  148. CommonUtil.UpdateItemPrefab(self, itemLua, showData)
  149. return item
  150. end
  151. function UIGuildDemonView:InitData()
  152. self:RefreshPlayerInfo()
  153. end
  154. function UIGuildDemonView:OnPageInEnd()
  155. self.super.OnPageInEnd(self)
  156. self.dmgRank.scrollRect.enabled = true
  157. end
  158. function UIGuildDemonView:AddUIEventListener()
  159. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  160. self.uiBase:AddButtonUniqueEventListener(self.btnPlayRule.button, self, self.OnClickPlayRuleBtn)
  161. self.uiBase:AddButtonUniqueEventListener(self.btnBack.button, self, self.OnClickBackBtn)
  162. self.uiBase:AddButtonUniqueEventListener(self.btnLog.button, self, self.OnClickLogRankBtn)
  163. self.uiBase:AddButtonUniqueEventListener(self.nowBox.button, self, self.OnClickOpenNowRewardBtn)
  164. self.uiBase:AddButtonUniqueEventListener(self.nextBox.button, self, self.OnClickOpenNextRewardBtn)
  165. self.uiBase:AddButtonUniqueEventListener(self.btnAdd.button, self, self.OnClickBuyTimesBtn)
  166. self.uiBase:AddButtonUniqueEventListener(self.bossName.button, self, self.OnClickBossNameBtn)
  167. self.uiBase:AddButtonUniqueEventListener(self.btnChallenge.button, self, self.OnClickBtnChallengeBtn)
  168. end
  169. function UIGuildDemonView:OnClickBtnChallengeBtn()
  170. self.controller:ChallengeBoss()
  171. end
  172. function UIGuildDemonView:OnClickBossNameBtn()
  173. local demonId = ManagerContainer.DataMgr.GuildDemonData:GetdemonId()
  174. local demonData = ManagerContainer.CfgMgr:GetGuildDemonCfgCfgById(demonId)
  175. if demonData and demonData.BossLvMax == 1 then
  176. ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("VipUpLvMax")
  177. return
  178. end
  179. --local nextLvDay = ManagerContainer.DataMgr.GuildDemonData:GetNextLvDay()
  180. ManagerContainer.LuaUIMgr:ShowMinTips("NextDay")
  181. end
  182. function UIGuildDemonView:OnClickPlayRuleBtn()
  183. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIPlayRule, {'PlayExplainTitle', 'GuildDemonExplain'})
  184. end
  185. function UIGuildDemonView:OnClickLogRankBtn()
  186. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIGuildDemonRank, nil, self.uiData.id)
  187. end
  188. function UIGuildDemonView:RefreshFightCountUI()
  189. local fightCount = ManagerContainer.DataMgr.GuildDemonData:GetfightCount()
  190. local fightTime = ManagerContainer.DataMgr.GuildDemonData:GetBossEndTime()
  191. local remainTime = nil
  192. if fightTime and fightTime > 0 then
  193. remainTime = ManagerContainer.LuaTimerMgr:GetRemainSecondsWithUInt64(fightTime)
  194. end
  195. self.btnChallenge.button.interactable = remainTime and remainTime > 0 and fightCount > 0
  196. self.timesBox.condTxt.text.text = I18N.SetLanguageValue("GuildInfo_034",fightCount)
  197. end
  198. function UIGuildDemonView:RefreshUIData()
  199. --获取当前显示BOSS
  200. local demonId = ManagerContainer.DataMgr.GuildDemonData:GetdemonId()
  201. local demonData = ManagerContainer.CfgMgr:GetGuildDemonCfgCfgById(demonId)
  202. if not demonData then
  203. return
  204. end
  205. local mvpBrief = ManagerContainer.DataMgr.GuildDemonData:GetmvpInfo()
  206. if mvpBrief then
  207. self.mvpEmpty:SetActive(false)
  208. local curRoleLv = mvpBrief.level
  209. local jobCfgId = mvpBrief.config_id
  210. local jobCfgData = ManagerContainer.CfgMgr:GetJobDataById(jobCfgId)
  211. local headIcon = CommonUtil.GetPlayerHeadIcon(mvpBrief)
  212. local _fakerData = {Level = curRoleLv, ProfessionIcon = jobCfgData.JobIcon, HeadIcon = headIcon, IsHero = true};
  213. local _headFrameId = mvpBrief.head_frame_id
  214. CommonUtil.SetPlayerHeadAndFrame(self, self.headItem, _fakerData,false, _headFrameId,self,self.OnClickOtherHeadBtn,mvpBrief.uid);
  215. local vipLv = mvpBrief.vip_level
  216. local vipIcon = nil
  217. if vipLv and vipLv >= 0 then
  218. local vipCfg = ManagerContainer.CfgMgr:GetVipCfgById(vipLv)
  219. if vipCfg then
  220. vipIcon = vipCfg.SmallIcon
  221. end
  222. end
  223. CommonUtil.LoadIcon(self, vipIcon , function (sprite)
  224. self.mvpVipIcon.image.sprite = sprite
  225. end)
  226. self.mvpName.text.text = CommonUtil.GetVaildNickName(mvpBrief.nick_name)
  227. else
  228. self.mvpEmpty:SetActive(true)
  229. end
  230. local bossLv = ManagerContainer.DataMgr.GuildDemonData:GetBossLv()
  231. local summonId = demonData.SummonId or 0
  232. local npcData = ManagerContainer.CfgMgr:GetNpcCfgById(summonId)
  233. if not npcData then
  234. return
  235. end
  236. self.bossName.text.text = I18N.SetLanguageValue("GuildDemonName",npcData.Name,bossLv)
  237. self:RefreshFightCountUI()
  238. --设置自己伤害量和MVP伤害量slider
  239. local totalHarm = ManagerContainer.DataMgr.GuildDemonData:GettotalHarm()
  240. local MVPHarm = ManagerContainer.DataMgr.GuildDemonData:GetmvpHarm()
  241. local myHarm = ManagerContainer.DataMgr.GuildDemonData:GetmyHarm()
  242. local myharm = myHarm / totalHarm
  243. local mvpharm = MVPHarm / totalHarm
  244. self.mvpSlider.slider.value = MVPHarm == 0 and MVPHarm or mvpharm
  245. self.mySlider.slider.value = myHarm == 0 and myHarm or myharm
  246. self.dmgNumber.text.text = CommonUtil.FormatNumber(myHarm)
  247. if myHarm == 0 then
  248. self.mySlidertxt.text.text = "0%"
  249. elseif myharm < 0.001 then
  250. self.mySlidertxt.text.text = "0.1%"
  251. elseif myharm >= 1 then
  252. self.mySlidertxt.text.text = "100%"
  253. elseif myharm >= 0.999 then
  254. self.mySlidertxt.text.text = "99.9%"
  255. else
  256. self.mySlidertxt.text.text = string.format("%.1f",myharm * 100).."%"
  257. end
  258. if MVPHarm == 0 then
  259. self.mvpSlidertxt.text.text = "0%"
  260. elseif mvpharm < 0.001 then
  261. self.mvpSlidertxt.text.text = "0.1%"
  262. elseif mvpharm >= 1 then
  263. self.mvpSlidertxt.text.text = "100%"
  264. elseif mvpharm >= 0.999 then
  265. self.mvpSlidertxt.text.text = "99.9%"
  266. else
  267. self.mvpSlidertxt.text.text = string.format("%.1f",mvpharm * 100).."%"
  268. end
  269. --设置当前和下一档次奖励宝箱图标
  270. local currRank = ManagerContainer.DataMgr.GuildDemonData:GetcurrRank()
  271. local nextRank = ManagerContainer.DataMgr.GuildDemonData:GetnextRank()
  272. local damageReward = demonData.DamageReward
  273. local damageSegment = CommonUtil.DeserializeGlobalStrToNumberTable(demonData.DamageSegment)
  274. if damageSegment and #damageSegment > 0 then
  275. local currMaxHarm = damageSegment[currRank + 1] and damageSegment[currRank + 1][2] or 0
  276. local nextMaxHarm = damageSegment[nextRank+ 1] and damageSegment[nextRank + 1][2] or damageSegment[#damageSegment][2]
  277. local harm = (totalHarm - currMaxHarm) / (nextMaxHarm - currMaxHarm)
  278. self.harmSlider.slider.value = totalHarm == 0 and totalHarm or harm
  279. if totalHarm == 0 then
  280. self.currSlidertxt.text.text = "0%"
  281. elseif harm < 0.001 then
  282. self.currSlidertxt.text.text = "0.1%"
  283. elseif harm >= 1 then
  284. self.currSlidertxt.text.text = "100%"
  285. elseif harm >= 0.999 then
  286. self.currSlidertxt.text.text = "99.9%"
  287. else
  288. self.currSlidertxt.text.text = string.format("%.1f",harm * 100).."%"
  289. end
  290. end
  291. local maxIndex = #demonData.DamageReward
  292. self.nowBox.button.interactable = currRank > 0 and currRank <= maxIndex
  293. self.nextBox.button.interactable = nextRank > 0 and nextRank <= maxIndex
  294. local nextRewardKey = "DscRewardNext"
  295. if damageReward and #damageReward > 0 then
  296. local currIcon = ""
  297. if currRank == 0 then
  298. currIcon = "Items/item_guild_demonbox0"
  299. else
  300. local currCfg = ManagerContainer.CfgMgr:GetItemById(damageReward[currRank][1])
  301. if currCfg then
  302. currIcon = currCfg.Icon
  303. end
  304. end
  305. local nextIcon = ""
  306. if nextRank > #damageReward then
  307. nextIcon = "Items/item_guild_demonbox0"
  308. nextRewardKey = "DscMaxReward"
  309. else
  310. local nextCfg = ManagerContainer.CfgMgr:GetItemById(damageReward[nextRank][1])
  311. if nextCfg then
  312. nextIcon = nextCfg.Icon
  313. end
  314. end
  315. CommonUtil.LoadIcon(self, currIcon , function (sprite)
  316. self.nowBox.image.sprite = sprite
  317. end)
  318. CommonUtil.LoadIcon(self, nextIcon , function (sprite)
  319. self.nextBox.image.sprite = sprite
  320. end)
  321. end
  322. self.nextTxt.text.text = I18N.SetLanguageValue(nextRewardKey)
  323. end
  324. function UIGuildDemonView:OnClickOpenNowRewardBtn()
  325. local currRank = ManagerContainer.DataMgr.GuildDemonData:GetcurrRank()
  326. local demonId = ManagerContainer.DataMgr.GuildDemonData:GetdemonId()
  327. local demonData = ManagerContainer.CfgMgr:GetGuildDemonCfgCfgById(demonId)
  328. if demonData and demonData.DamageReward then
  329. local maxIndex = #demonData.DamageReward
  330. if currRank <= 0 or currRank > maxIndex then
  331. return
  332. end
  333. local data = {showId = maxIndex - currRank,BossId = demonId}
  334. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIGuildDemonReward, data)
  335. end
  336. end
  337. function UIGuildDemonView:OnClickOpenNextRewardBtn()
  338. local nextRank = ManagerContainer.DataMgr.GuildDemonData:GetnextRank()
  339. local demonId = ManagerContainer.DataMgr.GuildDemonData:GetdemonId()
  340. local demonData = ManagerContainer.CfgMgr:GetGuildDemonCfgCfgById(demonId)
  341. if demonData and demonData.DamageReward then
  342. local maxIndex = #demonData.DamageReward
  343. if nextRank <= 0 or nextRank > maxIndex then
  344. return
  345. end
  346. local data = {showId = maxIndex - nextRank,BossId = demonId}
  347. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIGuildDemonReward, data)
  348. end
  349. end
  350. function UIGuildDemonView:OnClickBackBtn()
  351. ManagerContainer.LuaUIMgr:OpenSourceUI(self)
  352. end
  353. function UIGuildDemonView:OnHide()
  354. end
  355. function UIGuildDemonView:OnClickBuyTimesBtn()
  356. local demonId = ManagerContainer.DataMgr.GuildDemonData:GetdemonId()
  357. local demonData = ManagerContainer.CfgMgr:GetGuildDemonCfgCfgById(demonId)
  358. if not demonData then
  359. return
  360. end
  361. local cost = demonData.ChallengePrice
  362. local BuyTimes = ManagerContainer.DataMgr.GuildDemonData:GetbuyCount()
  363. local fucIsCanBuy = function(singlecost,count)
  364. return self:IsCanBuyTimes(singlecost,count)
  365. end
  366. local fucBuyOk = function(count)
  367. self:SureBuyTimes(count)
  368. end
  369. ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBuyTimes, {cost, BuyTimes ,fucIsCanBuy,fucBuyOk,demonData.ChallengeTimes})
  370. end
  371. function UIGuildDemonView:SureBuyTimes(count)
  372. ManagerContainer.DataMgr.GuildDemonData:SendGuildDemonBuyFighCountReq(count)
  373. end
  374. function UIGuildDemonView:IsCanBuyTimes(allcost)
  375. local AllCost = allcost
  376. local Goldcount = CommonUtil.GetOwnResCountByItemId(Enum.ItemType.Diamond)
  377. if Goldcount >= AllCost then
  378. return true
  379. end
  380. return false
  381. end
  382. function UIGuildDemonView:RefreshModel()
  383. self:DisposeModel()
  384. local demonId = ManagerContainer.DataMgr.GuildDemonData:GetdemonId()
  385. local bossLv = ManagerContainer.DataMgr.GuildDemonData:GetBossLv()
  386. local bossCfgData = ManagerContainer.CfgMgr:GetGuildDemonCfgCfgById(demonId)
  387. if not bossCfgData then
  388. return
  389. end
  390. local summonId = bossCfgData.SummonId or 0
  391. local npcCfgData = ManagerContainer.CfgMgr:GetNpcCfgById(summonId)
  392. if not npcCfgData then
  393. return
  394. end
  395. local avatarCfgData = ManagerContainer.CfgMgr:GetAvatarCfgById(npcCfgData.AvatarId)
  396. if not avatarCfgData then
  397. return
  398. end
  399. self.modelPath = avatarCfgData.AvatarPrefab
  400. self.modelPos = CommonUtil.TableToVector3(bossCfgData.ShowPos)
  401. self.modelRot = CommonUtil.TableToQuaternion(bossCfgData.ShowRot)
  402. self.seqId = ManagerContainer.ResMgr:LuaLoadAssets(Enum.ResourceType.GameObject, Constants.ModelPath, {self.modelPath}, self, self.ShowModel)
  403. end
  404. function UIGuildDemonView:ShowModel()
  405. self.modelGo = ManagerContainer.ResMgr:GetGoFromPool(Constants.ModelPath, self.modelPath)
  406. if self.previewSystem then
  407. self.previewSystem:AddGo(self.modelGo)
  408. end
  409. if ManagerContainer.LuaModelMgr and ManagerContainer.LuaModelMgr.ModelRoot then
  410. self.modelGo.transform:SetParent(ManagerContainer.LuaModelMgr.ModelRoot.transform)
  411. end
  412. if self.modelPos then
  413. self.modelGo.transform.localPosition = self.modelPos
  414. end
  415. if self.modelRot then
  416. self.modelGo.transform.localRotation = self.modelRot
  417. end
  418. end
  419. function UIGuildDemonView:DisposeModel()
  420. if self.seqId then
  421. ManagerContainer.ResMgr:ClearUIAsyncLoadReqsBySeqId(self.seqId)
  422. end
  423. self.seqId = nil
  424. if self.modelGo then
  425. ManagerContainer.ResMgr:RecycleGO(Constants.ModelPath, self.modelPath, self.modelGo)
  426. if self.previewSystem then
  427. self.previewSystem:RemoveGo(self.modelGo)
  428. end
  429. end
  430. self.modelPath = nil
  431. self.modelGo = nil
  432. end
  433. function UIGuildDemonView:OnShow(data)
  434. self.controller:SetData(data)
  435. end
  436. function UIGuildDemonView:OnClose()
  437. end
  438. function UIGuildDemonView:OnDispose()
  439. self:DisposeModel()
  440. if self.previewSystem then
  441. self.previewSystem:Dispose()
  442. self.previewSystem = nil
  443. end
  444. if self.loadStatusLoopListCtr then
  445. self.loadStatusLoopListCtr:Dispose()
  446. self.loadStatusLoopListCtr = nil
  447. end
  448. ManagerContainer.DataMgr.GuildDemonData:ClearGuildDemonViewInfos()
  449. self:StopRefreshTimer()
  450. self.controller:OnDispose()
  451. end
  452. return UIGuildDemonView