小兵抽卡修改
parent
1c91661d27
commit
cd8fd57e80
|
@ -26,7 +26,7 @@ this.funcBtnList = {}
|
||||||
local curMianTaskData = {}
|
local curMianTaskData = {}
|
||||||
local timePressStarted
|
local timePressStarted
|
||||||
local callBack
|
local callBack
|
||||||
|
this.thread=nil --协程
|
||||||
local count = 1
|
local count = 1
|
||||||
local autoTimer=nil
|
local autoTimer=nil
|
||||||
local maxKillNum=10
|
local maxKillNum=10
|
||||||
|
@ -322,32 +322,40 @@ function FightPointPassMainPanel:BindEvent()
|
||||||
autoTimer=nil
|
autoTimer=nil
|
||||||
end
|
end
|
||||||
UIManager.OpenPanel(UIName.SmallSoldierAutoPanel)
|
UIManager.OpenPanel(UIName.SmallSoldierAutoPanel)
|
||||||
autoTimer=Timer.New(function ()
|
this.thread=coroutine.start(function()
|
||||||
if SmallSoldierManager.isAuto==false then
|
|
||||||
if autoTimer then
|
while SmallSoldierManager.isAuto do
|
||||||
autoTimer:Stop()
|
if SmallSoldierManager.isAuto==false then
|
||||||
autoTimer=nil
|
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,4,-1,true):Start()
|
||||||
end
|
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()
|
|
||||||
UIManager.OpenPanel(UIName.SmallSoldierAutoPanel)
|
UIManager.OpenPanel(UIName.SmallSoldierAutoPanel)
|
||||||
end)
|
end)
|
||||||
Util.AddClick(this.costImg.gameObject,function ()
|
Util.AddClick(this.costImg.gameObject,function ()
|
||||||
|
@ -1600,7 +1608,10 @@ function FightPointPassMainPanel:OnClose()
|
||||||
-- fightMap:OnClose()
|
-- fightMap:OnClose()
|
||||||
-- hasMap = false
|
-- hasMap = false
|
||||||
-- end
|
-- end
|
||||||
|
if this.thread then
|
||||||
|
coroutine.stop(this.thread)
|
||||||
|
this.thread=nil
|
||||||
|
end
|
||||||
if timer1 then
|
if timer1 then
|
||||||
timer1:Stop()
|
timer1:Stop()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue