战斗调整

This commit is contained in:
xiekaidong 2023-06-29 21:14:24 +08:00
parent cae3580d2c
commit 36526bcd5e

View File

@ -1122,7 +1122,11 @@ function BattleBaseUI:onInitGridCellOver()
end) end)
cell:unBindAll() cell:unBindAll()
cell:bind(entity, "isDirty", function() cell:bind(entity, "isDirty", function()
cell:refresh(entity, self.curElementType) local elementType = self.curElementType
if not self.battleController:getPosIdInCurActionBoardRowRange(entity:getPosId()) then
elementType = nil
end
cell:refresh(entity, elementType)
end) end)
local pos = entity:getPos() local pos = entity:getPos()
cell:getBaseObject():setAnchoredPosition(pos.x, pos.y) cell:getBaseObject():setAnchoredPosition(pos.x, pos.y)
@ -1173,8 +1177,14 @@ end
function BattleBaseUI:refreshBoard() function BattleBaseUI:refreshBoard()
local entities = self.battleData:getGridEnties() local entities = self.battleData:getGridEnties()
for posId, entity in pairs(entities) do for posId, entity in pairs(entities) do
local elementType = self.curElementType
local skillPosId = self.skillPosId
if not self.battleController:getPosIdInCurActionBoardRowRange(posId) then
elementType = nil
skillPosId = nil
end
if entity and entity:getCell() then if entity and entity:getCell() then
entity:getCell():refresh(entity, self.curElementType, self.skillPosId) entity:getCell():refresh(entity, elementType, skillPosId)
end end
end end
end end