解锁动画

This commit is contained in:
chenxi 2023-05-30 18:49:18 +08:00
parent 44085f6c23
commit 9feb05f0e6

View File

@ -30,7 +30,7 @@ end
function ModuleUnlockUI:onLoadRootComplete()
self.uiMap = self.root:genAllChildren()
self.uiMap["module_unlock_ui.bg"]:addClickListener(function()
self:showModuleUnlockAnimation()
self:showNextModuleUnlockAnimation()
end)
self.moduleNameTx = self.uiMap["module_unlock_ui.name_tx"]
@ -41,23 +41,29 @@ function ModuleUnlockUI:onLoadRootComplete()
self:showModuleUnlockAnimation()
end
function ModuleUnlockUI:showNextModuleUnlockAnimation()
if self:showModuleUnlockAnimation() then
self:playUnlockAnimation()
end
end
function ModuleUnlockUI:showModuleUnlockAnimation()
if #self.unlockList <= 0 then
self:closeUI()
return
return false
end
local moduleKey = table.remove(self.unlockList, 1)
local info = ConfigManager:getConfig("func_open")[moduleKey]
local i18nInfo = I18N:getConfig("func_open")[moduleKey]
if info == nil or i18nInfo == nil then
self:closeUI()
return
return false
end
self.moduleNameTx:setText(i18nInfo.name)
self:playAnimation()
return true
end
function ModuleUnlockUI:playAnimation()
function ModuleUnlockUI:playUnlockAnimation()
if self.unlockAnimationSeq == nil then
local scaleTween1 = self.root:getTransform():DOScale(1.05, 0.15)
self.unlockAnimationSeq:Append(scaleTween1)