From 4e3871a39db4d53a9853c166ba1d34c67f83fffc Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Fri, 31 Oct 2025 15:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=87=E8=83=BD=E5=9D=97=E7=89=B9=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/battle/cell/grid_cell.lua | 61 +++++++++++++++++++++------- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/lua/app/ui/battle/cell/grid_cell.lua b/lua/app/ui/battle/cell/grid_cell.lua index b6543149..88d18c86 100644 --- a/lua/app/ui/battle/cell/grid_cell.lua +++ b/lua/app/ui/battle/cell/grid_cell.lua @@ -202,24 +202,51 @@ function GridCell:showHighLight(show, mainElementType) end end - local find = false - for type, obj in pairs(self.outLineSfxObjs) do - if show and not find then - if skillId then - if type == "skill" then + if not self.universalSfxObjs then + self.universalSfxObjs = {} + for i = 1, 5 do + self.universalSfxObjs[i] = uiMap["grid_cell.touch_node.ani_node.effect_node.sfx_piece_qizi_b06_" .. i] + end + end + + if isUniversal then + for k,v in pairs(self.universalSfxObjs) do + if mainElementType and mainElementType == k then + v:setActive(show) + else + v:setActive(false) + end + end + for k,v in pairs(self.outLineSfxObjs) do + if not mainElementType and "skill" == k then + v:setActive(show) + else + v:setActive(false) + end + end + else + for k,v in pairs(self.universalSfxObjs) do + v:setActive(false) + end + local find = false + for type, obj in pairs(self.outLineSfxObjs) do + if show and not find then + if skillId then + if type == "skill" then + find = true + end + elseif elementType == type then find = true end - elseif elementType == type then - find = true - end - if find then - if self.lastShowHlElementType ~= type then - self.lastShowHlElementType = type + if find then + if self.lastShowHlElementType ~= type then + self.lastShowHlElementType = type + end end + obj:setActive(find) + else + obj:setActive(false) end - obj:setActive(find) - else - obj:setActive(false) end end if not find then @@ -292,6 +319,12 @@ function GridCell:setOrder(uiOder) local skillEffect = uiMap["grid_cell.touch_node.ani_node.effect_node.sfx_piece_qizi_b06"] skillEffect:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(uiOder, GConst.UI_EFFECT_ORDER.LEVEL4 + 1) skillEffect:setActive(false) + + for i = 1, 5 do + local obj = uiMap["grid_cell.touch_node.ani_node.effect_node.sfx_piece_qizi_b06_" .. i] + obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(uiOder, GConst.UI_EFFECT_ORDER.LEVEL4 + 1) + obj:setActive(false) + end end function GridCell:setGridTypeIcon(icon)