Merge branch 'fang/anim' into dev
This commit is contained in:
commit
bbcc762928
@ -197,10 +197,13 @@ function BattleResultUI:initGoldPig()
|
|||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
self.goldPigRoot = uiMap["battle_result_ui.gold_pig"]
|
self.goldPigRoot = uiMap["battle_result_ui.gold_pig"]
|
||||||
self.goldPigRoot:setVisible(false)
|
self.goldPigRoot:setVisible(false)
|
||||||
|
self.goldPigGem = uiMap["battle_result_ui.gold_pig.gem_bg"]
|
||||||
self.goldPigGemTx = uiMap["battle_result_ui.gold_pig.gem_bg.gem_tx"]
|
self.goldPigGemTx = uiMap["battle_result_ui.gold_pig.gem_bg.gem_tx"]
|
||||||
self.goldPigGemImg = uiMap["battle_result_ui.gold_pig.gem_bg.gem_img"]
|
self.goldPigGemImg = uiMap["battle_result_ui.gold_pig.gem_bg.gem_img"]
|
||||||
self.goldPigGemSliderComp = uiMap["battle_result_ui.gold_pig.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
|
self.goldPigGemSliderComp = uiMap["battle_result_ui.gold_pig.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
|
||||||
self.goldPigGemSliderTx = uiMap["battle_result_ui.gold_pig.slider_bg.text"]
|
self.goldPigGemSliderTx = uiMap["battle_result_ui.gold_pig.slider_bg.text"]
|
||||||
|
self.goldPigSpine = uiMap["battle_result_ui.gold_pig.spine_pig"]
|
||||||
|
self.canvasGroupPigGem = self.goldPigGem:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:tryShowGoldPig()
|
function BattleResultUI:tryShowGoldPig()
|
||||||
@ -219,6 +222,17 @@ function BattleResultUI:tryShowGoldPig()
|
|||||||
if lastGemCount > currGemCount then
|
if lastGemCount > currGemCount then
|
||||||
lastGemCount = currGemCount
|
lastGemCount = currGemCount
|
||||||
end
|
end
|
||||||
|
if self.animPig == nil then
|
||||||
|
self.animPig = self.root:createBindTweenSequence()
|
||||||
|
self.animPig:Insert(0, self.canvasGroupPigGem:DOFade(0, 0))
|
||||||
|
self.animPig:Insert(1.5, self.canvasGroupPigGem:DOFade(1, 0.3))
|
||||||
|
self.animPig:SetAutoKill(false)
|
||||||
|
else
|
||||||
|
self.animPig:Restart()
|
||||||
|
end
|
||||||
|
self.goldPigSpine:playAnimComplete("idle1", false, false, function()
|
||||||
|
self.goldPigSpine:playAnim("idle2", true, false)
|
||||||
|
end)
|
||||||
self.goldPigGemTx:setText("+" .. currGemCount - lastGemCount)
|
self.goldPigGemTx:setText("+" .. currGemCount - lastGemCount)
|
||||||
GFunc.centerImgAndTx(self.goldPigGemImg, self.goldPigGemTx, 0, -4)
|
GFunc.centerImgAndTx(self.goldPigGemImg, self.goldPigGemTx, 0, -4)
|
||||||
if currGemCount > lastGemCount then
|
if currGemCount > lastGemCount then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user