英雄升级资源包添加排序
parent
3a952c6753
commit
3a4a24c725
|
@ -366,12 +366,18 @@ end
|
||||||
--通过物品类型获得物品list
|
--通过物品类型获得物品list
|
||||||
function this.GetItemDataByTimeIsGold(_id)
|
function this.GetItemDataByTimeIsGold(_id)
|
||||||
--LogError("_itemType ".._itemType)
|
--LogError("_itemType ".._itemType)
|
||||||
|
local list={}
|
||||||
for i, v in pairs(this.bagDatas) do
|
for i, v in pairs(this.bagDatas) do
|
||||||
if v.itemConfig.ItemType == ItemType.TimeIsGold and v.num > 0 and v.itemConfig.UseGain and v.itemConfig.UseGain[1][1]==_id then
|
if v.itemConfig.ItemType == ItemType.TimeIsGold and v.num > 0 and v.itemConfig.UseGain and v.itemConfig.UseGain[1][1]==_id then
|
||||||
return v
|
table.insert(list,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if #list>0 then
|
||||||
|
table.sort(list,function(a,b)
|
||||||
|
return a.itemConfig.Quantity > b.itemConfig.Quantity
|
||||||
|
end)
|
||||||
|
return list[1]
|
||||||
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue