diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 0870cbd3b7..17c30ddc2c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -26,7 +26,7 @@ this.funcBtnList = {} local curMianTaskData = {} local timePressStarted local callBack - +this.thread=nil --协程 local count = 1 local autoTimer=nil local maxKillNum=10 @@ -322,32 +322,40 @@ function FightPointPassMainPanel:BindEvent() autoTimer=nil end UIManager.OpenPanel(UIName.SmallSoldierAutoPanel) - autoTimer=Timer.New(function () - if SmallSoldierManager.isAuto==false then - if autoTimer then - autoTimer:Stop() - autoTimer=nil + this.thread=coroutine.start(function() + + while SmallSoldierManager.isAuto do + if SmallSoldierManager.isAuto==false then + if autoTimer then + autoTimer:Stop() + autoTimer=nil + + end + return + end + if BagManager.GetItemCountById(tonumber(cost[1]))