【森罗幻境】转盘小游戏修复抽中非物品时报错的问题
parent
41a923034d
commit
6fbec8a36e
|
@ -29,9 +29,8 @@ function this.Init(context, root, gameType, gameId, gameParams)
|
|||
end
|
||||
|
||||
|
||||
local id
|
||||
local num
|
||||
local itemId
|
||||
local resultId
|
||||
local stopId
|
||||
local isStart
|
||||
local timeSpace = 0
|
||||
local lastTime = 0
|
||||
|
@ -61,9 +60,8 @@ function this.Show()
|
|||
this.btnStart:GetComponent("Button").interactable = false
|
||||
TrialMiniGameManager.GameOperate(0, function(msg)
|
||||
--转起来
|
||||
id = msg.drop.itemlist[1].itemId
|
||||
num = msg.drop.itemlist[1].itemNum
|
||||
LogYellow("掉落的Id:"..id.." 数量:"..num)
|
||||
resultId = msg.resultId
|
||||
LogYellow("掉落的Id:"..resultId)
|
||||
this.test()
|
||||
--4秒后显示掉落
|
||||
-- Timer.New(function()
|
||||
|
@ -100,11 +98,11 @@ function this.test()
|
|||
-- coroutine.wait(0.1)
|
||||
-- end
|
||||
-- 减速
|
||||
for i = 0, 30 do
|
||||
for i = 0, 20 do
|
||||
timeSpace = timeSpace + 0.01
|
||||
coroutine.wait(0.1)
|
||||
end
|
||||
itemId = id
|
||||
stopId = resultId
|
||||
end)
|
||||
|
||||
isStart = true
|
||||
|
@ -122,18 +120,18 @@ function this.tableTurnEffect()
|
|||
redNext:SetActive(true)
|
||||
index = index + 1
|
||||
--检测最后的奖励
|
||||
if itemId and id == this.TrialGameConfig[this.list[index]].RewardID and num == this.TrialGameConfig[this.list[index]].Max then
|
||||
-- this.turnEffect:Stop()
|
||||
local cfg = this.TrialGameConfig[this.list[index]]
|
||||
if stopId and stopId == cfg.Id then
|
||||
--游戏结束显示掉落
|
||||
Timer.New(function()
|
||||
if TrialMiniGameManager.IsGameDone() then
|
||||
TrialMiniGameManager.EndGame()
|
||||
end
|
||||
local data = TrialMiniGameManager.IdToNameIconNum(id,num)
|
||||
local data = TrialMiniGameManager.IdToNameIconNum(cfg.RewardID, cfg.Max)
|
||||
PopupTipPanel.ShowColorTip(data[1],data[2],data[3])
|
||||
isStart = true
|
||||
itemId = nil
|
||||
end, 1,1,true):Start()
|
||||
isStart = false
|
||||
stopId = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue