From c01cc5c9dbee703e527f69d84c24ac3c03b903fe Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 27 Apr 2023 15:24:24 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/battle/controller/battle_controller.lua | 12 ++++++++++++ lua/app/ui/battle/battle_ui.lua | 6 +----- lua/app/ui/battle/cell/grid_cell.lua | 5 +++++ lua/app/userdata/battle/battle_grid_entity.lua | 1 + 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index d063a89f..fd6c2c97 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -926,6 +926,18 @@ function BattleController:onLinkOver() end end end + else + if entity:getIsIdle() then + if BattleConst.GRID_TYPE_BREAK_SFX[gridType] then + if not gridBreakSfxInfo then + gridBreakSfxInfo = {} + end + if not gridBreakSfxInfo[gridType] then + gridBreakSfxInfo[gridType] = {} + end + table.insert(gridBreakSfxInfo[gridType], posId) + end + end end end end diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index ac00478f..a842a22a 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -723,8 +723,6 @@ function BattleUI:initGridCell() CellManager:loadCellAsync(GRID_CELL_PATH, GRID_CELL, self.gridNode, function(cell) local posId = ModuleManager.BattleManager:getPosId(r, c) self.gridCells[posId] = cell - local gameObject = cell:getGameObject() - gameObject.name = "grid_cell_" .. posId cell:getBaseObject():setAnchoredPositionX(DEFAULT_X) -- 初始化时放到屏幕外 self.cellLoadRemianCount = self.cellLoadRemianCount - 1 @@ -855,6 +853,7 @@ function BattleUI:eliminationAni(sequence, callback) local entity = DataManager.BattleData:getGridEntity(info.posId) if entity and entity:getCell() then + entity:getCell():refresh(entity) local baseObject = entity:getCell():getBaseObject() baseObject:getTransform():SetAsLastSibling() if info.noAni then @@ -1119,10 +1118,7 @@ function BattleUI:fallGrid(listInfo, callback) self.fallAniCount = self.fallAniCount + 1 local entity = DataManager.BattleData:getGridEntity(posId) local cell = entity:getCell() - local posId = entity:getPosId() if cell then - local gameObject = cell:getGameObject() - gameObject.name = "grid_cell_" .. posId if cell.fallSeq then cell.fallSeq:Kill() cell.fallSeq = nil diff --git a/lua/app/ui/battle/cell/grid_cell.lua b/lua/app/ui/battle/cell/grid_cell.lua index fdafa1d7..b31bcb07 100644 --- a/lua/app/ui/battle/cell/grid_cell.lua +++ b/lua/app/ui/battle/cell/grid_cell.lua @@ -88,6 +88,11 @@ function GridCell:refresh(gridEntity, curElement, skillPosId) self:hideAni() end self:showHighLight(false, self.lastShowHlElementType) + + if self.lastPosId ~= gridEntity:getPosId() then + self.lastPosId = gridEntity:getPosId() + self:getGameObject().name = "grid_cell_" .. self.lastPosId + end end function GridCell:addTouchListener(func) diff --git a/lua/app/userdata/battle/battle_grid_entity.lua b/lua/app/userdata/battle/battle_grid_entity.lua index 73e5acf0..89d4dd8d 100644 --- a/lua/app/userdata/battle/battle_grid_entity.lua +++ b/lua/app/userdata/battle/battle_grid_entity.lua @@ -85,6 +85,7 @@ end function BattleGridEntity:addAroundEliminationCount(boomType) if self:getIsIdle() then + self:setGridType(BattleConst.GRID_TYPE.EMPTY) return false end local nextGridType = BattleConst.AROUND_ELIMINATION_TO_TYPE_COUNT[self.gridType]