【upview】优化被关闭后依然可以通过事件触发报错的问题

dev_chengFeng
gaoxin 2021-06-05 00:25:54 +08:00
parent 518cb7dac1
commit 3204bd5945
1 changed files with 7 additions and 1 deletions

View File

@ -170,6 +170,7 @@ function UpView:OnClose()
self.timer:Stop() self.timer:Stop()
self.timer = nil self.timer = nil
end end
self.IsClose = true
end end
function UpView:SetShowType(context) function UpView:SetShowType(context)
@ -198,6 +199,9 @@ function UpView:SetShowType(context)
end end
function UpView:UpdateGoldVal() function UpView:UpdateGoldVal()
if self.IsClose then
return
end
-- 先清一遍红点 -- 先清一遍红点
self:_ClearRP() self:_ClearRP()
local panelShowItemList = self.itemList local panelShowItemList = self.itemList
@ -228,7 +232,9 @@ function UpView:UpdateGoldVal()
self:_BindRP(panelShowItemList[i], redpot) self:_BindRP(panelShowItemList[i], redpot)
end end
else else
self.cnyList[i].gameObject:SetActive(false) if self.cnyList[i].gameObject then
self.cnyList[i].gameObject:SetActive(false)
end
end end
end end
end end