【轩辕宝镜】通关到最后一层,打开界面时列表位置没有固定在最新关

gaoxin 2021-12-30 22:37:35 +08:00
parent d10d2f976a
commit e901bd9d3b
1 changed files with 5 additions and 1 deletions

View File

@ -145,13 +145,17 @@ function this:SwitchView(isNotAni)
table.insert(list, go)
end
,true,isNotAni)
local t = 1
local t = 0
for k,v in ipairs(dataList) do
if v.state == 1 then
t = k
break
end
end
-- t = 0说明没有找到可以挑战的关卡也就是全部通关了
if t <= 0 then
t = #dataList
end
this.ScrollView:SetIndex(t - 1 < 1 and 1 or (t - 1))
end