解锁动画
This commit is contained in:
parent
44085f6c23
commit
9feb05f0e6
@ -30,7 +30,7 @@ end
|
|||||||
function ModuleUnlockUI:onLoadRootComplete()
|
function ModuleUnlockUI:onLoadRootComplete()
|
||||||
self.uiMap = self.root:genAllChildren()
|
self.uiMap = self.root:genAllChildren()
|
||||||
self.uiMap["module_unlock_ui.bg"]:addClickListener(function()
|
self.uiMap["module_unlock_ui.bg"]:addClickListener(function()
|
||||||
self:showModuleUnlockAnimation()
|
self:showNextModuleUnlockAnimation()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self.moduleNameTx = self.uiMap["module_unlock_ui.name_tx"]
|
self.moduleNameTx = self.uiMap["module_unlock_ui.name_tx"]
|
||||||
@ -41,23 +41,29 @@ function ModuleUnlockUI:onLoadRootComplete()
|
|||||||
self:showModuleUnlockAnimation()
|
self:showModuleUnlockAnimation()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ModuleUnlockUI:showNextModuleUnlockAnimation()
|
||||||
|
if self:showModuleUnlockAnimation() then
|
||||||
|
self:playUnlockAnimation()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function ModuleUnlockUI:showModuleUnlockAnimation()
|
function ModuleUnlockUI:showModuleUnlockAnimation()
|
||||||
if #self.unlockList <= 0 then
|
if #self.unlockList <= 0 then
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
return
|
return false
|
||||||
end
|
end
|
||||||
local moduleKey = table.remove(self.unlockList, 1)
|
local moduleKey = table.remove(self.unlockList, 1)
|
||||||
local info = ConfigManager:getConfig("func_open")[moduleKey]
|
local info = ConfigManager:getConfig("func_open")[moduleKey]
|
||||||
local i18nInfo = I18N:getConfig("func_open")[moduleKey]
|
local i18nInfo = I18N:getConfig("func_open")[moduleKey]
|
||||||
if info == nil or i18nInfo == nil then
|
if info == nil or i18nInfo == nil then
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
return
|
return false
|
||||||
end
|
end
|
||||||
self.moduleNameTx:setText(i18nInfo.name)
|
self.moduleNameTx:setText(i18nInfo.name)
|
||||||
self:playAnimation()
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function ModuleUnlockUI:playAnimation()
|
function ModuleUnlockUI:playUnlockAnimation()
|
||||||
if self.unlockAnimationSeq == nil then
|
if self.unlockAnimationSeq == nil then
|
||||||
local scaleTween1 = self.root:getTransform():DOScale(1.05, 0.15)
|
local scaleTween1 = self.root:getTransform():DOScale(1.05, 0.15)
|
||||||
self.unlockAnimationSeq:Append(scaleTween1)
|
self.unlockAnimationSeq:Append(scaleTween1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user