diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua index d82e13b89c..2b55382e85 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/XuanYuanMirrorPanel.lua @@ -144,45 +144,47 @@ end this.refreshShow = function() local openFunctions = {} - for k,v in pairs(activityType) do - local go = Util.GetGameObject(this.AnimRoot, v.gameObject) - go:GetComponent("Image").sprite = this.spLoader:LoadSprite(v.bg) - local textParnet = Util.GetGameObject(go, "titileBg") - local textName = Util.GetGameObject(textParnet, "Text"):GetComponent("Text") - textName.text =v.name - SetTextVerTial(Util.GetGameObject(textParnet, "Text"),Vector3.New(295.93,-10.17,0),"MiddleRight") - if GetCurLanguage() == 2 then - textName.fontSize = 36 - end - - local state = XuanYuanMirrorManager.GetMirrorState(k) == 1 - --LogGreen(k.." 宝镜state:"..XuanYuanMirrorManager.GetMirrorState(k)) - if not state or state == 0 then - local timeStr = this:GetOpenTime(k) - Util.GetGameObject(go, "timeBg/Text"):GetComponent("Text").text = timeStr..Language[10310] - Util.GetGameObject(go, "redPoint").gameObject:SetActive(false) - else - openFunctions[k] = {} - openFunctions[k].timeComp = Util.GetGameObject(go, "timeBg/Text"):GetComponent("Text") - if XuanYuanMirrorManager.CarbonRedCheck() then - Util.GetGameObject(go, "redPoint").gameObject:SetActive(true) - else - Util.GetGameObject(go, "redPoint").gameObject:SetActive(false) - end - end - Util.SetGray(go,not state) - Util.AddOnceClick(go ,function() - if state then - LogBlue("宝镜状态:"..activityType[k].name..XuanYuanMirrorManager.GetMirrorState(k)) - UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,k) - else - LogBlue("宝镜未开启提示:"..activityType[k].name.."未开启!") - PopupTipPanel.ShowTip(activityType[k].name..Language[10338]) - end - end) + for k,v in pairs(activityType) do + local go = Util.GetGameObject(this.AnimRoot, v.gameObject) + if go then + go:GetComponent("Image").sprite = this.spLoader:LoadSprite(v.bg) + local textParnet = Util.GetGameObject(go, "titileBg") + local textName = Util.GetGameObject(textParnet, "Text"):GetComponent("Text") + textName.text =v.name + SetTextVerTial(Util.GetGameObject(textParnet, "Text"),Vector3.New(295.93,-10.17,0),"MiddleRight") + if GetCurLanguage() == 2 then + textName.fontSize = 36 end - this:TimeCountDown(openFunctions) - this.remainTimes.text = XuanYuanMirrorManager.GetTimeTip() + + local state = XuanYuanMirrorManager.GetMirrorState(k) == 1 + --LogGreen(k.." 宝镜state:"..XuanYuanMirrorManager.GetMirrorState(k)) + if not state or state == 0 then + local timeStr = this:GetOpenTime(k) + Util.GetGameObject(go, "timeBg/Text"):GetComponent("Text").text = timeStr..Language[10310] + Util.GetGameObject(go, "redPoint").gameObject:SetActive(false) + else + openFunctions[k] = {} + openFunctions[k].timeComp = Util.GetGameObject(go, "timeBg/Text"):GetComponent("Text") + if XuanYuanMirrorManager.CarbonRedCheck() then + Util.GetGameObject(go, "redPoint").gameObject:SetActive(true) + else + Util.GetGameObject(go, "redPoint").gameObject:SetActive(false) + end + end + Util.SetGray(go,not state) + Util.AddOnceClick(go ,function() + if state then + LogBlue("宝镜状态:"..activityType[k].name..XuanYuanMirrorManager.GetMirrorState(k)) + UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,k) + else + LogBlue("宝镜未开启提示:"..activityType[k].name.."未开启!") + PopupTipPanel.ShowTip(activityType[k].name..Language[10338]) + end + end) + end + end + this:TimeCountDown(openFunctions) + this.remainTimes.text = XuanYuanMirrorManager.GetTimeTip() end this.UpdateCarbonContent = function(...)