From 6c673d79778bf934c32c4df6b673cbe48628a0e3 Mon Sep 17 00:00:00 2001 From: CloudJ Date: Mon, 5 Jun 2023 16:50:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=AC=E5=94=A4=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/common/cell/hero_cell.lua | 4 ++++ lua/app/ui/shop/box_reward_ui.lua | 11 ++++++++++- lua/app/ui/shop/cell/box_hero_cell.lua | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index 5873885c..8646a464 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -121,6 +121,10 @@ function HeroCell:setVisible(visible, scale) self.baseObject:setVisible(visible, scale) end +function HeroCell:setSpineVisible(visible, scale) + self.lvUpArrow:setVisible(visible, scale) +end + function HeroCell:setGray(isGray) if self.isGray == isGray then return diff --git a/lua/app/ui/shop/box_reward_ui.lua b/lua/app/ui/shop/box_reward_ui.lua index eedde5a1..72c8970c 100644 --- a/lua/app/ui/shop/box_reward_ui.lua +++ b/lua/app/ui/shop/box_reward_ui.lua @@ -202,12 +202,22 @@ function BoxRewardUI:playCellAction(cell, idx) local seq = cell.baseObject:createBindTweenSequence() table.insert(self.cellSeqs, seq) + local tween = canvasGroup:DOFade(1, FADE_TIME) seq:AppendInterval(delayTime) tween:SetEase(CS.DG.Tweening.Ease.InOutSine) + seq:AppendCallback(function() + cell:setSpineVisible(false) -- 防止spine因透明度变化导致的闪白 + end) seq:Append(tween) seq:AppendCallback(function() if not self:isClosed() then + -- 如果需要spine 则显示 + local heroEntity = DataManager.HeroData:getHeroById(self.fragmentRewards[idx].id) + if heroEntity and heroEntity:canLvUp() then + cell:setSpineVisible(true) + end + self.actionStatus[idx] = true self:turnToNext(idx) -- 最后一个表现完毕 @@ -274,7 +284,6 @@ function BoxRewardUI:jump() for _, cellSeq in ipairs(self.cellSeqs) do cellSeq.timeScale = JUMP_TIME_SCALE end - self.cellSeqs = nil end if self.contentSeq then self.contentSeq.timeScale = JUMP_TIME_SCALE diff --git a/lua/app/ui/shop/cell/box_hero_cell.lua b/lua/app/ui/shop/cell/box_hero_cell.lua index 3544df4e..c524b0ce 100644 --- a/lua/app/ui/shop/cell/box_hero_cell.lua +++ b/lua/app/ui/shop/cell/box_hero_cell.lua @@ -20,6 +20,10 @@ function BoxHeroCell:refresh(data) self.heroNumText:setText("X" .. tostring(num)) end +function BoxHeroCell:setSpineVisible(visible) + self.heroCell:setSpineVisible(visible) +end + function BoxHeroCell:setVisible(visible) self.baseObject:setVisible(visible) end