From 98d46965f9b028bbf5127f04347aa05eb2c1bb8c Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 29 Jun 2023 15:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/helper/board_helper.lua | 18 ++++++++++++++++++ .../module/battle/helper/board_helper.lua.meta | 10 ++++++++++ lua/app/ui/battle/battle_ui.lua | 4 ++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 lua/app/module/battle/helper/board_helper.lua create mode 100644 lua/app/module/battle/helper/board_helper.lua.meta diff --git a/lua/app/module/battle/helper/board_helper.lua b/lua/app/module/battle/helper/board_helper.lua new file mode 100644 index 00000000..7f7d76a4 --- /dev/null +++ b/lua/app/module/battle/helper/board_helper.lua @@ -0,0 +1,18 @@ +local BoardHelper = {} + +function BoardHelper:findPvpLinkOptimalSolution(battleController, minRow, maxRow) + local battleData = battleController.battleData + local gridEntities = {} + for row = minRow, maxRow do -- 遍历所有的可使用格子 + for column = 1, GConst.BattleConst.COLUMN_COUNT do + local posId = ModuleManager.BattleManager:getPosId(row, column) + local gridEntity = battleData:getGridEnties()[posId] + if gridEntity and gridEntity:canLink() then + table.insert(gridEntities, gridEntity) + end + end + end + +end + +return BoardHelper \ No newline at end of file diff --git a/lua/app/module/battle/helper/board_helper.lua.meta b/lua/app/module/battle/helper/board_helper.lua.meta new file mode 100644 index 00000000..0161f01a --- /dev/null +++ b/lua/app/module/battle/helper/board_helper.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bbee47300a895dd49a69730e9ca51053 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index 33b7c02c..d5890c92 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -5,8 +5,8 @@ local SELECT_SKILL_CELL = "app/ui/battle/cell/select_skill_cell" local BATTLE_SELECT_SKILL_COMP = "app/ui/battle/battle_skill_select_comp" local DEFAULT_X = 10000 -local BOARD_POS_UP = BF.Vector2(0, 0) -local BOARD_POS_DOWN = BF.Vector2(0, 0) +local BOARD_POS_UP = BF.Vector2(0, 47) +local BOARD_POS_DOWN = BF.Vector2(0, -740) local CacheVector2 = CS.UnityEngine.Vector2(0, 0) ---------------------------------必须重写的方法---------------------------------- function BattleUI:initBaseInfo()