//--------------------------------------------------------
|
// [Author]: Alee
|
// [ Date ]: 2021年7月1日
|
//--------------------------------------------------------
|
|
using LitJson;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using System.Linq;
|
//分部类
|
public partial class ILShentongLVConfig : IConfigPostProcess
|
{
|
public static Dictionary<int, int> shentongLVConfig = new Dictionary<int, int>();
|
public static Dictionary<int, List<Int2>> useItemDict = new Dictionary<int, List<Int2>>();
|
public static List<int> needItemIDs = new List<int>(); //不重复的物品ID
|
public void OnConfigParseCompleted()
|
{
|
var key = ShentongID * 10000 + ShentongClassLV * 100 + ShentongLV;
|
shentongLVConfig[key] = ID;
|
var items = JsonMapper.ToObject<int[][]>(LVLightNeedItem);
|
List<Int2> tmp = new List<Int2>();
|
for (int i = 0; i < items.Length; i++)
|
{
|
var itemID = items[i][0];
|
tmp.Add(new Int2(itemID, items[i][1]));
|
if (!needItemIDs.Contains(itemID))
|
{
|
needItemIDs.Add(itemID);
|
}
|
}
|
useItemDict[ID] = tmp;
|
}
|
|
public static int GetShentongLVID(int id, int classLV, int lv)
|
{
|
var key = id * 10000 + classLV * 100 + lv;
|
if (shentongLVConfig.ContainsKey(key))
|
return shentongLVConfig[key];
|
|
return -1;
|
}
|
|
public static List<Int2> GetUseItems(int id)
|
{
|
return useItemDict[id];
|
}
|
|
|
}
|