From 404fa2ca30745ea5511383ee9fd3f5b2e85e7762 Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 5 Jun 2023 18:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=95=8C=E9=9D=A2=E9=87=91?= =?UTF-8?q?=E7=8C=AA=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/battle/battle_result_ui.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/app/ui/battle/battle_result_ui.lua b/lua/app/ui/battle/battle_result_ui.lua index 0b2b433c..cf61b5df 100644 --- a/lua/app/ui/battle/battle_result_ui.lua +++ b/lua/app/ui/battle/battle_result_ui.lua @@ -197,10 +197,13 @@ function BattleResultUI:initGoldPig() local uiMap = self.root:genAllChildren() self.goldPigRoot = uiMap["battle_result_ui.gold_pig"] 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.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.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 function BattleResultUI:tryShowGoldPig() @@ -219,6 +222,17 @@ function BattleResultUI:tryShowGoldPig() if lastGemCount > currGemCount then lastGemCount = currGemCount 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) GFunc.centerImgAndTx(self.goldPigGemImg, self.goldPigGemTx, 0, -4) if currGemCount > lastGemCount then