竞技场动画

This commit is contained in:
puxuan 2025-11-04 18:33:03 +08:00
parent e801062ca8
commit e15975a2cb

View File

@ -62,6 +62,7 @@ function ArenaMatchUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
-- 匹配等待页 -- 匹配等待页
self.matchSpine = uiMap["arena_match_ui.ui_spine_obj"]
self.matchLoading = uiMap["arena_match_ui.match_loading"] self.matchLoading = uiMap["arena_match_ui.match_loading"]
self.txSeason = uiMap["arena_match_ui.match_loading.tx_season"] self.txSeason = uiMap["arena_match_ui.match_loading.tx_season"]
self.txLoading = uiMap["arena_match_ui.match_loading.tx_loading"] self.txLoading = uiMap["arena_match_ui.match_loading.tx_loading"]
@ -73,17 +74,17 @@ function ArenaMatchUI:onLoadRootComplete()
self.btnClose = uiMap["arena_match_ui.match_result.btn_close"] self.btnClose = uiMap["arena_match_ui.match_result.btn_close"]
self.matchAnimator = self.matchResult:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR) self.matchAnimator = self.matchResult:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
-- 对手信息 -- 对手信息
self.matchAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL) self.matchAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.left_node.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
self.matchTxName = uiMap["arena_match_ui.match_result.match.info.tx_name"] self.matchTxName = uiMap["arena_match_ui.match_result.left_node.match.info.tx_name"]
self.matchTxLevel = uiMap["arena_match_ui.match_result.match.info.tx_level"] self.matchTxLevel = uiMap["arena_match_ui.match_result.left_node.match.info.tx_level"]
self.matchGrading = uiMap["arena_match_ui.match_result.match.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL) self.matchGrading = uiMap["arena_match_ui.match_result.left_node.match.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
self.matchHeroFormationComp = uiMap["arena_match_ui.match_result.match.formation.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP) self.matchHeroFormationComp = uiMap["arena_match_ui.match_result.left_node.match.formation.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
-- 自己信息 -- 自己信息
self.selfAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL) self.selfAvatar = CellManager:addCellComp(uiMap["arena_match_ui.match_result.right_node.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
self.selfTxName = uiMap["arena_match_ui.match_result.self.info.tx_name"] self.selfTxName = uiMap["arena_match_ui.match_result.right_node.self.info.tx_name"]
self.selfTxLevel = uiMap["arena_match_ui.match_result.self.info.tx_level"] self.selfTxLevel = uiMap["arena_match_ui.match_result.right_node.self.info.tx_level"]
self.selfGrading = uiMap["arena_match_ui.match_result.self.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL) self.selfGrading = uiMap["arena_match_ui.match_result.right_node.self.arena_grading_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.ARENA_GRADING_CELL)
self.selfHeroFormationComp = uiMap["arena_match_ui.match_result.self.formation.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP) self.selfHeroFormationComp = uiMap["arena_match_ui.match_result.right_node.self.formation.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
-- 功能按钮 -- 功能按钮
self.btnStart = uiMap["arena_match_ui.match_result.btn_start"] self.btnStart = uiMap["arena_match_ui.match_result.btn_start"]
self.imgCost = uiMap["arena_match_ui.match_result.btn_start.cost.img_cost"] self.imgCost = uiMap["arena_match_ui.match_result.btn_start.cost.img_cost"]
@ -127,7 +128,10 @@ function ArenaMatchUI:onRefresh()
ModuleManager.ArenaManager:reqMatch() ModuleManager.ArenaManager:reqMatch()
self:showMatchLoading() self:showMatchLoading()
else else
self.matchSpine:setActive(true)
self.matchSpine:playAnimComplete("die", false, true, function()
self:showMatchResult() self:showMatchResult()
end)
end end
end end
@ -136,6 +140,10 @@ function ArenaMatchUI:showMatchLoading()
self.matchLoading:setActive(true) self.matchLoading:setActive(true)
self.matchResult:setActive(false) self.matchResult:setActive(false)
UIManager:setBarsVisible(self, false) UIManager:setBarsVisible(self, false)
self.matchSpine:setActive(true)
self.matchSpine:playAnimComplete("born", false, true, function()
self.matchSpine:playAnim("idle", true, true)
end)
self.txSeason:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_21, DataManager.ArenaData:getSeason())) self.txSeason:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_21, DataManager.ArenaData:getSeason()))
self.txLoading:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_22)) self.txLoading:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_22))
@ -146,7 +154,10 @@ function ArenaMatchUI:showMatchLoading()
self:unscheduleGlobal(self.waitSid) self:unscheduleGlobal(self.waitSid)
end end
self.waitSid = self:performWithDelayGlobal(function() self.waitSid = self:performWithDelayGlobal(function()
self.matchSpine:setActive(true)
self.matchSpine:playAnimComplete("die", false, true, function()
self:showMatchResult() self:showMatchResult()
end)
end, 1.5) end, 1.5)
end end
@ -162,9 +173,9 @@ function ArenaMatchUI:showMatchResult()
self.matchResult:setActive(true) self.matchResult:setActive(true)
UIManager:setBarsVisible(self, true) UIManager:setBarsVisible(self, true)
self.spineVS:playAnimComplete("born", false, true, function() -- self.spineVS:playAnimComplete("born", false, true, function()
self.spineVS:playAnim("idle", true, true) -- self.spineVS:playAnim("idle", true, true)
end) -- end)
self.txStart:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE)) self.txStart:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
self.txConst:setText(DataManager.ArenaData:getFightCostNum()) self.txConst:setText(DataManager.ArenaData:getFightCostNum())