抽卡表现调整
This commit is contained in:
parent
2a5d350837
commit
8badb72aec
@ -40,9 +40,6 @@ function BoxOpenUI:onLoadRootComplete()
|
|||||||
-- 播放spine表现 播放完毕后打开奖励UI
|
-- 播放spine表现 播放完毕后打开奖励UI
|
||||||
self.spineObj = self.uiMap["box_open_ui.ui_spine_obj"]
|
self.spineObj = self.uiMap["box_open_ui.ui_spine_obj"]
|
||||||
local spineName
|
local spineName
|
||||||
|
|
||||||
Logger.logHighlight("type:%s index:%s", self.type, self.index)
|
|
||||||
|
|
||||||
if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then
|
if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then
|
||||||
spineName = SUMMON_SPINE_NAME[self.index]
|
spineName = SUMMON_SPINE_NAME[self.index]
|
||||||
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then
|
elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then
|
||||||
|
|||||||
@ -159,6 +159,7 @@ function BoxRewardUI:onLoadRootComplete()
|
|||||||
if i <= rewardCount then
|
if i <= rewardCount then
|
||||||
self.rewardCells[i]:setVisible(true)
|
self.rewardCells[i]:setVisible(true)
|
||||||
self.rewardCells[i]:refresh(self.fragmentRewards[i])
|
self.rewardCells[i]:refresh(self.fragmentRewards[i])
|
||||||
|
self.rewardCells[i]:disableAllEffect()
|
||||||
else
|
else
|
||||||
self.rewardCells[i]:setVisible(false)
|
self.rewardCells[i]:setVisible(false)
|
||||||
end
|
end
|
||||||
@ -203,15 +204,23 @@ function BoxRewardUI:playCellAction(cell, idx)
|
|||||||
local seq = cell.baseObject:createBindTweenSequence()
|
local seq = cell.baseObject:createBindTweenSequence()
|
||||||
table.insert(self.cellSeqs, seq)
|
table.insert(self.cellSeqs, seq)
|
||||||
|
|
||||||
local tween = canvasGroup:DOFade(1, FADE_TIME)
|
-- local tween = canvasGroup:DOFade(1, FADE_TIME)
|
||||||
seq:AppendInterval(delayTime)
|
seq:AppendInterval(delayTime)
|
||||||
tween:SetEase(CS.DG.Tweening.Ease.InOutSine)
|
-- tween:SetEase(CS.DG.Tweening.Ease.InOutSine)
|
||||||
seq:AppendCallback(function()
|
seq:AppendCallback(function()
|
||||||
cell:setSpineVisible(false) -- 防止spine因透明度变化导致的闪白
|
cell:setSpineVisible(false) -- 防止spine因透明度变化导致的闪白
|
||||||
end)
|
end)
|
||||||
seq:Append(tween)
|
-- seq:Append(tween)
|
||||||
seq:AppendCallback(function()
|
seq:AppendCallback(function()
|
||||||
if not self:isClosed() then
|
if not self:isClosed() then
|
||||||
|
-- 恢复显示
|
||||||
|
canvasGroup.alpha = 1
|
||||||
|
-- 特效
|
||||||
|
if self.isPlayAni then
|
||||||
|
cell:playEffect()
|
||||||
|
else
|
||||||
|
cell:disableAllEffect()
|
||||||
|
end
|
||||||
-- 如果需要spine 则显示
|
-- 如果需要spine 则显示
|
||||||
local heroEntity = DataManager.HeroData:getHeroById(self.fragmentRewards[idx].id)
|
local heroEntity = DataManager.HeroData:getHeroById(self.fragmentRewards[idx].id)
|
||||||
if heroEntity and heroEntity:canLvUp() then
|
if heroEntity and heroEntity:canLvUp() then
|
||||||
@ -298,6 +307,7 @@ function BoxRewardUI:jump()
|
|||||||
canvasGroup = cell.baseObject:addComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
canvasGroup = cell.baseObject:addComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||||
end
|
end
|
||||||
canvasGroup.alpha = 1
|
canvasGroup.alpha = 1
|
||||||
|
cell:disableAllEffect()
|
||||||
end
|
end
|
||||||
self.scrollRectContent:setAnchoredPositionY(self.maxScrollContentHeight - BASE_CONTENT_HEIGHT)
|
self.scrollRectContent:setAnchoredPositionY(self.maxScrollContentHeight - BASE_CONTENT_HEIGHT)
|
||||||
self.turnIdx = self.maxIdx
|
self.turnIdx = self.maxIdx
|
||||||
|
|||||||
@ -4,6 +4,11 @@ function BoxHeroCell:init()
|
|||||||
local uiMap = self.baseObject:genAllChildren()
|
local uiMap = self.baseObject:genAllChildren()
|
||||||
self.heroCell = CellManager:addCellComp(uiMap["cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL)
|
self.heroCell = CellManager:addCellComp(uiMap["cell.hero_cell"], GConst.TYPEOF_LUA_CLASS.HERO_CELL)
|
||||||
self.heroNumText = uiMap["cell.num_tx"]
|
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
|
end
|
||||||
|
|
||||||
function BoxHeroCell:refresh(data)
|
function BoxHeroCell:refresh(data)
|
||||||
@ -20,6 +25,32 @@ function BoxHeroCell:refresh(data)
|
|||||||
self.heroNumText:setText("X" .. tostring(num))
|
self.heroNumText:setText("X" .. tostring(num))
|
||||||
end
|
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)
|
function BoxHeroCell:setSpineVisible(visible)
|
||||||
self.heroCell:setSpineVisible(visible)
|
self.heroCell:setSpineVisible(visible)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user