小兵抽卡修改

tcx_xiyou_dev
PC-202302260912\Administrator 2024-05-16 19:05:40 +08:00
parent 1c91661d27
commit cd8fd57e80
1 changed files with 38 additions and 27 deletions

View File

@ -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]))<tonumber(cost[2]) then
PopupTipPanel.ShowTip("道具不足")
SmallSoldierManager.isAuto=false
if autoTimer then
autoTimer:Stop()
autoTimer=nil
end
UIManager.ClosePanel(UIName.SmallSoldierAutoPanel)
return
end
coroutine.wait(3)
if SmallSoldierManager.changeSolider==nil then
NetManager.RecruitSoldierRequest(function ()
this.RefreshSoliderInfo()
end)
end
end
-- autoTimer=Timer.New(function ()
end
return
end
if BagManager.GetItemCountById(tonumber(cost[1]))<tonumber(cost[2]) then
PopupTipPanel.ShowTip("道具不足")
SmallSoldierManager.isAuto=false
if autoTimer then
autoTimer:Stop()
autoTimer=nil
end
UIManager.ClosePanel(UIName.SmallSoldierAutoPanel)
return
end
if SmallSoldierManager.changeSolider==nil then
NetManager.RecruitSoldierRequest(function ()
this.RefreshSoliderInfo()
end)
end
end,4,-1,true):Start()
-- end,4,-1,true):Start()
end)
UIManager.OpenPanel(UIName.SmallSoldierAutoPanel)
end)
Util.AddClick(this.costImg.gameObject,function ()
@ -1600,7 +1608,10 @@ function FightPointPassMainPanel:OnClose()
-- fightMap:OnClose()
-- hasMap = false
-- end
if this.thread then
coroutine.stop(this.thread)
this.thread=nil
end
if timer1 then
timer1:Stop()
end