竞技场节奏调整
This commit is contained in:
parent
e7c6c45f0d
commit
2ad12c4b46
@ -1470,6 +1470,7 @@ function BattleBaseUI:generateSkillAni(map, callback, side)
|
||||
local pos = self:getPosInfo(info.posId)
|
||||
self.generateSkillAniSeq:Append(cell:getBaseObject():getTransform():DOAnchorPos(pos, 0.5))
|
||||
if self.generateSkillSfxs and self.generateSkillSfxs[count] then
|
||||
self:setGenerateSkillSfxsParent(info.posId, self.generateSkillSfxs[count])
|
||||
self.generateSkillSfxs[count]:setAnchoredPosition(pos.x, pos.y)
|
||||
self.generateSkillAniSeq:AppendCallback(function()
|
||||
self.generateSkillSfxs[count]:setActive(true)
|
||||
@ -1486,6 +1487,9 @@ function BattleBaseUI:generateSkillAni(map, callback, side)
|
||||
end)
|
||||
end
|
||||
|
||||
function BattleBaseUI:setGenerateSkillSfxsParent(posId, obj)
|
||||
end
|
||||
|
||||
function BattleBaseUI:_hideGenerateSkillGridCells(generateSkillCellPrefix)
|
||||
if not self.generateSkillGridEntities then
|
||||
local uiMap = self.root:genAllChildren()
|
||||
|
||||
@ -21,6 +21,9 @@ function BattleUIPVP:initBaseInfo()
|
||||
self.battleRoot = uiMap["battle_ui_pvp.battle_root"]
|
||||
self.maxLayerNode = uiMap["battle_ui_pvp.battle_root.battle_node.max_layer_show_node"]
|
||||
self.touchMask = uiMap["battle_ui_pvp.board_root_node.touch_mask"]
|
||||
self.atkBoard = self.uiMap["battle_ui_pvp.board_root_node.board_center_node.board_node_atk.board_atk"]
|
||||
self.defBoard = self.uiMap["battle_ui_pvp.board_root_node.board_center_node.board_node_atk.board_def"]
|
||||
self.boardRootNodeMask = self.uiMap["battle_ui_pvp.board_root_node.mask"]
|
||||
end
|
||||
|
||||
function BattleUIPVP:initBg()
|
||||
@ -209,15 +212,57 @@ function BattleUIPVP:refreshWave(wave, iconAtlas, iconName)
|
||||
icon:setSprite(iconAtlas, iconName)
|
||||
end
|
||||
|
||||
function BattleBaseUI:enterShowBoardAni(callback)
|
||||
function BattleUIPVP:setGenerateSkillSfxsParent(posId, obj)
|
||||
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
||||
if isAtkAction then
|
||||
obj:setParent(self.atkBoard, true)
|
||||
else
|
||||
obj:setParent(self.defBoard, true)
|
||||
end
|
||||
end
|
||||
|
||||
function BattleUIPVP:dealBoardMaskOnShowAni(isOver)
|
||||
local targetX = isOver and 0 or DEFAULT_X
|
||||
self.boardMask:setAnchoredPositionX(targetX)
|
||||
end
|
||||
|
||||
function BattleUIPVP:enterShowBoardAni(callback)
|
||||
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
||||
if self.touchMask then
|
||||
self.touchMask:setVisible(not isAtkAction)
|
||||
end
|
||||
|
||||
self:dealBoardMaskOnShowAni()
|
||||
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
||||
if entity:getCell() then
|
||||
local inCurRange = self.battleController:getPosIdInCurActionBoardRowRange(posId)
|
||||
local parent
|
||||
if isAtkAction then
|
||||
parent = inCurRange and self.atkBoard or self.defBoard
|
||||
else
|
||||
parent = inCurRange and self.defBoard or self.atkBoard
|
||||
end
|
||||
if parent then
|
||||
entity:getCell():getBaseObject():setParent(parent, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:clearEnterShowBoardSeq()
|
||||
self:getBoardRootNode():setVisible(true)
|
||||
self:getBoardRootNode():setAnchoredPositionX(0)
|
||||
self.enterShowBoardSeq = self.root:createBindTweenSequence()
|
||||
self.enterShowBoardSeq:Append(self:getBoardRootNode():getTransform():DOLocalMoveX(0, 0.5))
|
||||
self.enterShowBoardSeq:Append(self.defBoard:getTransform():DOAnchorPosX(0, 0.5))
|
||||
self.enterShowBoardSeq:Join(self.atkBoard:getTransform():DOAnchorPosX(0, 0.5))
|
||||
self.enterShowBoardSeq:Join(self.boardRootNodeMask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0.9, 0.5))
|
||||
self.enterShowBoardSeq:AppendCallback(function()
|
||||
self:dealBoardMaskOnShowAni(true)
|
||||
|
||||
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
||||
if entity:getCell() then
|
||||
entity:getCell():getBaseObject():setParent(self.gridNode, true)
|
||||
end
|
||||
end
|
||||
local str
|
||||
if isAtkAction then
|
||||
str = I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLE_DESC_1)
|
||||
@ -231,13 +276,35 @@ function BattleBaseUI:enterShowBoardAni(callback)
|
||||
end)
|
||||
end
|
||||
|
||||
function BattleBaseUI:enterHideBoardAni(callback)
|
||||
function BattleUIPVP:enterHideBoardAni(callback)
|
||||
self:dealBoardMaskOnShowAni()
|
||||
|
||||
local isAtkAction = self.battleController.curActionSide == GConst.BattleConst.SIDE_ATK
|
||||
for posId, entity in pairs(self.battleController.battleData:getGridEnties()) do
|
||||
if entity:getCell() then
|
||||
local inCurRange = self.battleController:getPosIdInCurActionBoardRowRange(posId)
|
||||
local parent
|
||||
if isAtkAction then
|
||||
parent = inCurRange and self.atkBoard or self.defBoard
|
||||
else
|
||||
parent = inCurRange and self.defBoard or self.atkBoard
|
||||
end
|
||||
if parent then
|
||||
entity:getCell():getBaseObject():setParent(parent, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:clearEnterShowBoardSeq()
|
||||
self.enterShowBoardSeq = self.root:createBindTweenSequence()
|
||||
self.enterShowBoardSeq:AppendInterval(0.5)
|
||||
local w, h = GFunc.getUIExpandScreenSize()
|
||||
self.enterShowBoardSeq:Append(self:getBoardRootNode():getTransform():DOLocalMoveX(w / 2 + 360, 0.5))
|
||||
self.enterShowBoardSeq:Append(self.defBoard:getTransform():DOAnchorPosX(w + 360, 0.5))
|
||||
self.enterShowBoardSeq:Join(self.atkBoard:getTransform():DOAnchorPosX(-(w + 360), 0.5))
|
||||
self.enterShowBoardSeq:Join(self.boardRootNodeMask:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0, 0.5))
|
||||
self.enterShowBoardSeq:AppendCallback(function()
|
||||
self:dealBoardMaskOnShowAni(true)
|
||||
self:getBoardRootNode():setVisible(false)
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user