Merge branch 'fang/victory_anim' into dev
This commit is contained in:
commit
2b9970188d
@ -70,10 +70,10 @@ end
|
|||||||
|
|
||||||
function BattleResultUI:refreshFixedInfo()
|
function BattleResultUI:refreshFixedInfo()
|
||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
local icon = uiMap["battle_result_ui.icon"]
|
local icon = uiMap["battle_result_ui.unit_node.icon"]
|
||||||
local desc1 = uiMap["battle_result_ui.desc_1"]
|
local desc1 = uiMap["battle_result_ui.unit_node.desc_1"]
|
||||||
local desc2 = uiMap["battle_result_ui.desc_2"]
|
local desc2 = uiMap["battle_result_ui.unit_node.desc_2"]
|
||||||
local desc3 = uiMap["battle_result_ui.desc_3"]
|
local desc3 = uiMap["battle_result_ui.unit_node.desc_3"]
|
||||||
local rewardTitle = uiMap["battle_result_ui.reward_node.reward_title"]
|
local rewardTitle = uiMap["battle_result_ui.reward_node.reward_title"]
|
||||||
local continue = uiMap["battle_result_ui.continue"]
|
local continue = uiMap["battle_result_ui.continue"]
|
||||||
desc1:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_4))
|
desc1:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_4))
|
||||||
@ -90,12 +90,13 @@ function BattleResultUI:refreshVictoryNode()
|
|||||||
uiMap["battle_result_ui.mask_d"]:setVisible(false)
|
uiMap["battle_result_ui.mask_d"]:setVisible(false)
|
||||||
uiMap["battle_result_ui.defeat_node"]:setVisible(false)
|
uiMap["battle_result_ui.defeat_node"]:setVisible(false)
|
||||||
uiMap["battle_result_ui.victory_node"]:setVisible(true)
|
uiMap["battle_result_ui.victory_node"]:setVisible(true)
|
||||||
uiMap["battle_result_ui.report_img_v"]:setVisible(true)
|
uiMap["battle_result_ui.victory_node.unit_node.report_img_v"]:setVisible(true)
|
||||||
uiMap["battle_result_ui.report_img_d"]:setVisible(false)
|
uiMap["battle_result_ui.defeat_node.unit_node.report_img_d"]:setVisible(false)
|
||||||
uiMap["battle_result_ui.victory_node.title_bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_5))
|
uiMap["battle_result_ui.victory_node.title_bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_5))
|
||||||
uiMap["battle_result_ui.victory_node.ui_spine_obj"]:playAnimComplete("born", true, true, function()
|
uiMap["battle_result_ui.victory_node.ui_spine_obj"]:playAnimComplete("born", true, true, function()
|
||||||
uiMap["battle_result_ui.victory_node.ui_spine_obj"]:playAnim("idle", true, true)
|
uiMap["battle_result_ui.victory_node.ui_spine_obj"]:playAnim("idle", true, true)
|
||||||
end)
|
end)
|
||||||
|
self:refreshUnitNodeAnim(uiMap["battle_result_ui.victory_node.unit_node"])
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:refreshDefeatNode()
|
function BattleResultUI:refreshDefeatNode()
|
||||||
@ -104,10 +105,30 @@ function BattleResultUI:refreshDefeatNode()
|
|||||||
uiMap["battle_result_ui.mask_d"]:setVisible(true)
|
uiMap["battle_result_ui.mask_d"]:setVisible(true)
|
||||||
uiMap["battle_result_ui.defeat_node"]:setVisible(true)
|
uiMap["battle_result_ui.defeat_node"]:setVisible(true)
|
||||||
uiMap["battle_result_ui.victory_node"]:setVisible(false)
|
uiMap["battle_result_ui.victory_node"]:setVisible(false)
|
||||||
uiMap["battle_result_ui.report_img_v"]:setVisible(false)
|
uiMap["battle_result_ui.victory_node.unit_node.report_img_v"]:setVisible(false)
|
||||||
uiMap["battle_result_ui.report_img_d"]:setVisible(true)
|
uiMap["battle_result_ui.defeat_node.unit_node.report_img_d"]:setVisible(true)
|
||||||
uiMap["battle_result_ui.defeat_node.title_bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_6))
|
uiMap["battle_result_ui.defeat_node.title_bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_6))
|
||||||
uiMap["battle_result_ui.defeat_node.ui_spine_obj"]:playAnim("idle", false, true)
|
uiMap["battle_result_ui.defeat_node.ui_spine_obj"]:playAnim("idle", false, true)
|
||||||
|
self:refreshUnitNodeAnim(uiMap["battle_result_ui.defeat_node.unit_node"])
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleResultUI:refreshUnitNodeAnim(parent)
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
uiMap["battle_result_ui.unit_node"]:setParent(parent, true)
|
||||||
|
local canvasNodeUnit = parent:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||||
|
|
||||||
|
if self.animUnit == nil then
|
||||||
|
self.animUnit = self.root:createBindTweenSequence()
|
||||||
|
self.animUnit:Insert(0, canvasNodeUnit:DOFade(0, 0))
|
||||||
|
self.animUnit:Insert(0.1, canvasNodeUnit:DOFade(1, 0))
|
||||||
|
self.animUnit:Insert(0, parent:getTransform():DOScale(0, 0))
|
||||||
|
self.animUnit:Insert(0.1, parent:getTransform():DOScale(0.35, 0))
|
||||||
|
self.animUnit:Insert(0.13, parent:getTransform():DOScale(1.1, 0.16))
|
||||||
|
self.animUnit:Insert(0.26, parent:getTransform():DOScale(1, 0.14))
|
||||||
|
self.animUnit:SetAutoKill(false)
|
||||||
|
else
|
||||||
|
self.animUnit:Restart()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:refreshRewards()
|
function BattleResultUI:refreshRewards()
|
||||||
@ -126,6 +147,7 @@ function BattleResultUI:refreshRewards()
|
|||||||
end)
|
end)
|
||||||
self.scrollRectComp:addRefreshCallback(function(index, cell)
|
self.scrollRectComp:addRefreshCallback(function(index, cell)
|
||||||
cell:refresh(self.rewards[index])
|
cell:refresh(self.rewards[index])
|
||||||
|
cell:showAppearAnim(index)
|
||||||
cell:showRightUpIcon(index <= self.mysteryBoxIdx, GConst.ATLAS_PATH.COMMON, "common_chest_1")
|
cell:showRightUpIcon(index <= self.mysteryBoxIdx, GConst.ATLAS_PATH.COMMON, "common_chest_1")
|
||||||
end)
|
end)
|
||||||
self.scrollRectComp:setFadeArgs(0.05, 0.3)
|
self.scrollRectComp:setFadeArgs(0.05, 0.3)
|
||||||
@ -150,7 +172,7 @@ function BattleResultUI:refreshRewards()
|
|||||||
scrollRect:setSizeDeltaX(112*rewardCount)
|
scrollRect:setSizeDeltaX(112*rewardCount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.scrollRectComp:refillCells(rewardCount, true)
|
self.scrollRectComp:refillCells(rewardCount)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleResultUI:refreshUnitInfo()
|
function BattleResultUI:refreshUnitInfo()
|
||||||
@ -158,7 +180,7 @@ function BattleResultUI:refreshUnitInfo()
|
|||||||
if not self.unitResultReportCells then
|
if not self.unitResultReportCells then
|
||||||
self.unitResultReportCells = {}
|
self.unitResultReportCells = {}
|
||||||
for index = 1, 5 do
|
for index = 1, 5 do
|
||||||
self.unitResultReportCells[index] = CellManager:addCellComp(uiMap["battle_result_ui.unit_result_report_cell_" .. index], UNIT_RESULT_RERPORT_CELL)
|
self.unitResultReportCells[index] = CellManager:addCellComp(uiMap["battle_result_ui.unit_node.unit_result_report_cell_" .. index], UNIT_RESULT_RERPORT_CELL)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ function RewardCell:init()
|
|||||||
ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject)
|
ModuleManager.TipsManager:showRewardTips(self.rewardId, self.rewardType, self.baseObject)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
self.canvasGroup = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||||
end
|
end
|
||||||
|
|
||||||
function RewardCell:refresh(reward)
|
function RewardCell:refresh(reward)
|
||||||
@ -155,4 +156,24 @@ function RewardCell:showRightUpIcon(show, atlas, iconName)
|
|||||||
self.rightUpIcon:setSprite(atlas, iconName)
|
self.rightUpIcon:setSprite(atlas, iconName)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 展示结算奖励的出现动画
|
||||||
|
function RewardCell:showAppearAnim(idx)
|
||||||
|
local selfObj = self.baseObject
|
||||||
|
local delay = (idx - 1) * 0.05
|
||||||
|
local scaleX = self.baseObject:fastGetLocalScale()
|
||||||
|
|
||||||
|
if self.animAppear == nil then
|
||||||
|
self.animAppear = selfObj:createBindTweenSequence()
|
||||||
|
self.animAppear:Insert(0, self.canvasGroup:DOFade(0, 0))
|
||||||
|
self.animAppear:Insert(0, selfObj:getTransform():DOScale(scaleX * 0.6, 0))
|
||||||
|
self.animAppear:Insert(0.3 + delay, selfObj:getTransform():DOScale(scaleX * 1.1, 0.1))
|
||||||
|
self.animAppear:Insert(0.3 + delay, self.canvasGroup:DOFade(1, 0.1))
|
||||||
|
self.animAppear:Insert(0.4 + delay, selfObj:getTransform():DOScale(scaleX * 1, 0.13))
|
||||||
|
self.animAppear:SetAutoKill(false)
|
||||||
|
else
|
||||||
|
self.animAppear:Restart()
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
return RewardCell
|
return RewardCell
|
||||||
Loading…
x
Reference in New Issue
Block a user