抽卡表现调整

This commit is contained in:
CloudJ 2023-06-05 20:17:11 +08:00
parent 2a5d350837
commit 8badb72aec
3 changed files with 44 additions and 6 deletions

View File

@ -40,9 +40,6 @@ function BoxOpenUI:onLoadRootComplete()
-- 播放spine表现 播放完毕后打开奖励UI
self.spineObj = self.uiMap["box_open_ui.ui_spine_obj"]
local spineName
Logger.logHighlight("type:%s index:%s", self.type, self.index)
if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then
spineName = SUMMON_SPINE_NAME[self.index]
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then

View File

@ -159,6 +159,7 @@ function BoxRewardUI:onLoadRootComplete()
if i <= rewardCount then
self.rewardCells[i]:setVisible(true)
self.rewardCells[i]:refresh(self.fragmentRewards[i])
self.rewardCells[i]:disableAllEffect()
else
self.rewardCells[i]:setVisible(false)
end
@ -203,15 +204,23 @@ function BoxRewardUI:playCellAction(cell, idx)
local seq = cell.baseObject:createBindTweenSequence()
table.insert(self.cellSeqs, seq)
local tween = canvasGroup:DOFade(1, FADE_TIME)
-- local tween = canvasGroup:DOFade(1, FADE_TIME)
seq:AppendInterval(delayTime)
tween:SetEase(CS.DG.Tweening.Ease.InOutSine)
-- tween:SetEase(CS.DG.Tweening.Ease.InOutSine)
seq:AppendCallback(function()
cell:setSpineVisible(false) -- 防止spine因透明度变化导致的闪白
end)
seq:Append(tween)
-- seq:Append(tween)
seq:AppendCallback(function()
if not self:isClosed() then
-- 恢复显示
canvasGroup.alpha = 1
-- 特效
if self.isPlayAni then
cell:playEffect()
else
cell:disableAllEffect()
end
-- 如果需要spine 则显示
local heroEntity = DataManager.HeroData:getHeroById(self.fragmentRewards[idx].id)
if heroEntity and heroEntity:canLvUp() then
@ -298,6 +307,7 @@ function BoxRewardUI:jump()
canvasGroup = cell.baseObject:addComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
end
canvasGroup.alpha = 1
cell:disableAllEffect()
end
self.scrollRectContent:setAnchoredPositionY(self.maxScrollContentHeight - BASE_CONTENT_HEIGHT)
self.turnIdx = self.maxIdx

View File

@ -4,6 +4,11 @@ function BoxHeroCell:init()
local uiMap = self.baseObject:genAllChildren()
self.heroCell = CellManager:addCellComp(uiMap["cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL)
self.heroNumText = uiMap["cell.num_tx"]
self.effects = {}
self.effects[2] = uiMap["cell.effect_node.sfx_ui_zhaohuan_lv_b01"]
self.effects[3] = uiMap["cell.effect_node.sfx_ui_zhaohuan_lan_b01"]
self.effects[4] = uiMap["cell.effect_node.sfx_ui_zhaohuan_zi_b01"]
self:disableAllEffect()
end
function BoxHeroCell:refresh(data)
@ -20,6 +25,32 @@ function BoxHeroCell:refresh(data)
self.heroNumText:setText("X" .. tostring(num))
end
function BoxHeroCell:playEffect()
if self.data and self.effects then
local id = self.data.id
local heroInfo = ConfigManager:getConfig("hero")[id]
if heroInfo then
local qlt = heroInfo.qlt
for key, effect in pairs(self.effects) do
if key == qlt then
effect:setActive(true)
effect:play()
else
effect:setActive(false)
end
end
end
end
end
function BoxHeroCell:disableAllEffect()
if self.effects then
for key, effect in pairs(self.effects) do
effect:setActive(false)
end
end
end
function BoxHeroCell:setSpineVisible(visible)
self.heroCell:setSpineVisible(visible)
end