public List <UpgradeRequire> GetStarUpCost(EquiptType type, int level) { PlayerStrengthCost cost = m_StarUpCost.SingleOrDefault(c => c.lGoodsSubClass == type && c.GainLevel == level); if (cost != null) { return(cost.UpgradeRequires); } else { return(new List <UpgradeRequire>()); } }
private static void OnPostprocessEquipment() { string path = System.IO.Path.Combine(RESOURCE_DATA_FOLDER, "PlayerStrengthCost.xml"); TextReader tr = new StreamReader(path); string text = tr.ReadToEnd(); if (text == null) { Debug.LogError("Equipment item file not exist"); return; } else { XmlSpreadSheetReader.ReadSheet(text); XmlSpreadSheet sheet = XmlSpreadSheetReader.Output; string[] keys = XmlSpreadSheetReader.Keys; object[] levelIds = sheet[keys[0]]; List <PlayerStrengthCost> tempList = new List <PlayerStrengthCost>(); for (int i = 2; i < levelIds.Length; i++) { //if (0 == i) continue; PlayerStrengthCost data = new PlayerStrengthCost(); data.GainType = (UpgradeType)Convert.ToInt32(sheet["GainType"][i]); data.GainLevel = Convert.ToInt32(sheet["GainLevel"][i]); data.lGoodsSubClass = (EquiptType)Convert.ToInt32(sheet["lGoodsSubClass"][i]); string[] UpgradeRequireStr = Convert.ToString(sheet["UpgradeRequires"][i]).Split('|'); List <UpgradeRequire> UpgradeRequires = new List <UpgradeRequire>(); foreach (string item in UpgradeRequireStr) { UpgradeRequire ur = new UpgradeRequire(); string[] strs = item.Split('+'); ur.GoodsId = Convert.ToInt32(strs[0]); ur.Count = Convert.ToInt32(strs[1]); UpgradeRequires.Add(ur); } data.UpgradeRequires = UpgradeRequires; tempList.Add(data); } CreateMedicamentConfigDataList(tempList); } }