【副本界面】提交
parent
e3baabda96
commit
dd8f907259
|
@ -83,6 +83,7 @@ function CarbonsPanel:InitComponent()
|
|||
self.btnList = {}
|
||||
self.timeList = {}
|
||||
self.effectList = {}
|
||||
self.randomList = {}
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
@ -115,6 +116,7 @@ end
|
|||
|
||||
function CarbonsPanel:ShowMap()
|
||||
for key, value in pairs(carbonData) do
|
||||
self.randomList[#self.randomList + 1] = key
|
||||
local go = self.btnList[key]
|
||||
local selfObj = Util.GetGameObject(self.map,value.objName)
|
||||
if not go then
|
||||
|
@ -225,6 +227,10 @@ function CarbonsPanel:SetTime()
|
|||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
if self.timer2 then
|
||||
self.timer2:Stop()
|
||||
self.timer2 = nil
|
||||
end
|
||||
self.timer = Timer.New(function ()
|
||||
for key, item in pairs(self.timeList) do
|
||||
item.TextObj.text = string.format("%s%s",item.Text,TimeToFelaxible(item.time))
|
||||
|
@ -235,6 +241,15 @@ function CarbonsPanel:SetTime()
|
|||
end
|
||||
end, 1, -1, true)
|
||||
self.timer:Start()
|
||||
|
||||
self.timer2 = Timer.New(function ()
|
||||
for key, value in pairs(self.effectList) do
|
||||
value:SetActive(false)
|
||||
end
|
||||
local num = math.random(1,#self.randomList)
|
||||
self.effectList[self.randomList[num]]:SetActive(true)
|
||||
end, 5, -1, true)
|
||||
self.timer2:Start()
|
||||
end
|
||||
|
||||
--点击
|
||||
|
@ -354,6 +369,10 @@ function CarbonsPanel:OnClose()
|
|||
self.timer:Stop()
|
||||
self.timer = nil
|
||||
end
|
||||
if self.timer2 then
|
||||
self.timer2:Stop()
|
||||
self.timer2 = nil
|
||||
end
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
Loading…
Reference in New Issue