| | |
| | | //获取最小未领取的物品索引
|
| | | public int GetJumpStartIndex(int zhanLingType)
|
| | | {
|
| | | int nowNeedValue = PlayerDatas.Instance.baseData.LV;
|
| | | List<int> zhanLingLvList = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList();
|
| | | int maxNeedValue = ILZhanlingConfig.GetTypeToIDDict(zhanLingType).Keys.ToList()[0];
|
| | | for (int i = 0; i < zhanLingLvList.Count; i++)
|
| | | int nowNeedValue = (int)GetNowValue();
|
| | | var infoDict = ILZhanlingConfig.GetTypeToIDDict(zhanLingType);
|
| | | if (infoDict.IsNullOrEmpty())
|
| | | return 0;
|
| | | List<int> infoList = infoDict.Keys.ToList();
|
| | | if (infoList.IsNullOrEmpty())
|
| | | return 0;
|
| | |
|
| | | int index = 0;
|
| | | for (int i = 0; i < infoList.Count; i++)
|
| | | {
|
| | | if (nowNeedValue >= zhanLingLvList[i])
|
| | | int needValue = infoList[i];
|
| | | //可领取
|
| | | if (nowNeedValue >= needValue)
|
| | | {
|
| | | if (zhanLingInfoDict[zhanLingType].isActivite > 0)
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], false) || !IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | if (!IsHaveZhanLingGift(zhanLingType, needValue, false) || !IsHaveZhanLingGift(zhanLingType, needValue, true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, zhanLingLvList[i], true))
|
| | | if (!IsHaveZhanLingGift(zhanLingType, needValue, true))
|
| | | {
|
| | | maxNeedValue = zhanLingLvList[i];
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!IsHaveZhanLingGift(zhanLingType, needValue, false) || !IsHaveZhanLingGift(zhanLingType, needValue, true))
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | return Math.Max(0, ILZhanlingConfig.GetTypeToIDDict(zhanLingType)[maxNeedValue] - 1);
|
| | | return Math.Max(0, index - 2);
|
| | | }
|
| | |
|
| | | //一键获取所有可领取的礼品,弹出展示窗口
|