消除显示优化

This commit is contained in:
xiekaidong 2023-06-05 20:51:50 +08:00
parent d4cf1c58fd
commit cc77a77193
2 changed files with 24 additions and 2 deletions

View File

@ -1122,7 +1122,8 @@ function BattleController:dealGridBreak(posId, condition, time, breakedMap, sequ
aniUnit.callback = nil aniUnit.callback = nil
for index, id in ipairs(list) do for index, id in ipairs(list) do
if id ~= posId then if id ~= posId then
self:dealGridBreak(id, GRID_BREAK_CONDITION.SKILL, time + BattleConst.GRID_BREAK_EFFECT_INTERVAL * index, breakedMap, sequenceMap, aniSequence, gridMap, onlyCheck) local timeIdx = time + BattleConst.GRID_BREAK_EFFECT_INTERVAL * (index - 1) -- 因为第一个是自己,所以-1
self:dealGridBreak(id, GRID_BREAK_CONDITION.SKILL, timeIdx, breakedMap, sequenceMap, aniSequence, gridMap, onlyCheck)
table.insert(aniUnit.aniPosList, id) table.insert(aniUnit.aniPosList, id)
end end
end end

View File

@ -16,6 +16,12 @@ local CACHE_SKILL_POS_1 = {x = 10, y = 360}
local CACHE_SKILL_POS_2 = {x = 10, y = 420} local CACHE_SKILL_POS_2 = {x = 10, y = 420}
local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png" local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png"
local BOARD_SFX_ORDER = GConst.UI_EFFECT_ORDER.LEVEL4 + 1 local BOARD_SFX_ORDER = GConst.UI_EFFECT_ORDER.LEVEL4 + 1
local MAX_LASTSIBLING_TYPE = {
[8] = true,
[9] = true,
[10] = true,
[11] = true,
}
function BattleUI:getPrefabPath() function BattleUI:getPrefabPath()
return "assets/prefabs/ui/battle/battle_ui.prefab" return "assets/prefabs/ui/battle/battle_ui.prefab"
@ -967,7 +973,9 @@ function BattleUI:eliminationAni(aniSequence, effectGridMap, callback)
self.eliminationAniSeq:Insert(time, baseObject:getTransform():DOLocalPath(posList, anitime):SetEase(CS.DG.Tweening.Ease.Linear)) self.eliminationAniSeq:Insert(time, baseObject:getTransform():DOLocalPath(posList, anitime):SetEase(CS.DG.Tweening.Ease.Linear))
else else
if info.noAni then if info.noAni then
baseObject:setAnchoredPositionX(DEFAULT_X) self.eliminationAniSeq:InsertCallback(time, function()
baseObject:setAnchoredPositionX(DEFAULT_X)
end)
else else
if info.rangeList then if info.rangeList then
self.eliminationAniSeq:InsertCallback(time, function() self.eliminationAniSeq:InsertCallback(time, function()
@ -1003,10 +1011,23 @@ function BattleUI:eliminationAni(aniSequence, effectGridMap, callback)
end end
end end
local list
for posId, _ in pairs(effectGridMap) do for posId, _ in pairs(effectGridMap) do
local entity = DataManager.BattleData:getGridEntity(posId) local entity = DataManager.BattleData:getGridEntity(posId)
local baseObject = entity:getCell():getBaseObject() local baseObject = entity:getCell():getBaseObject()
baseObject:getTransform():SetAsLastSibling() baseObject:getTransform():SetAsLastSibling()
if MAX_LASTSIBLING_TYPE[entity:getGridType()] then
if not list then
list = {}
end
table.insert(list, baseObject)
end
end
if list then
for _, baseObject in ipairs(list) do
baseObject:getTransform():SetAsLastSibling()
end
end end
self.eliminationAniSeq:AppendCallback(function() self.eliminationAniSeq:AppendCallback(function()