From 99ae5cb8eca15db91a9f577533cf46eb0519540d Mon Sep 17 00:00:00 2001 From: yuanshuai <243578945@qq.com> Date: Thu, 28 Apr 2022 16:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A2=E7=B4=A2=E7=95=8C=E9=9D=A2=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=BC=96=E9=98=9F=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Formation/View/ExploreFormation.lua | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua index 40b32b5d1c..e3c2ecb515 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/ExploreFormation.lua @@ -1,6 +1,6 @@ ----- 关卡 ----- -local CarbonFormation = {} -local this = CarbonFormation +local ExploreFormation = {} +local this = ExploreFormation local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig) local SpecialConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,141) --- 是否需要切换编队的功能 @@ -64,18 +64,15 @@ function this.GetOneKeyUpHeroList() end --- btn1点击回调事件 -function this.On_Btn2_Click() +function this.On_Btn2_Click(formationId) if not hadClick then hadClick = true - for k,v in pairs(this.FormationData) do - if k == this.GetFormationIndex() then - FormationManager.SaveFormation(k, this.root.choosedList, - FormationManager.formationList[k].teamPokemonInfos) - else - FormationManager.SaveFormation(k, v.formationinfo, - FormationManager.formationList[k].teamPokemonInfos) - end + if this.FormationData[formationId] then + local formationinfo=this.FormationData[formationId].formationinfo + local teamPokemonInfos=FormationManager.formationList[formationId].teamPokemonInfos + FormationManager.SaveFormation(formationId,formationinfo,teamPokemonInfos) end + end this.root:ClosePanel() end