public void Init(UpgradeRequire upgradeRequire) { ItemFielInfo itemfileinfo = new ItemFielInfo(upgradeRequire.GoodsId); iconItem.Init(itemfileinfo); Lable_name.SetText(NGUIColor.SetTxtColor(LanguageTextManager.GetString(itemfileinfo.LocalItemData._szGoodsName), (TextColor)itemfileinfo.LocalItemData._ColorLevel)); if (upgradeRequire.GoodsId == 3050001) { if (upgradeRequire.Count <= ContainerInfomanager.Instance.GetOwnMaterialCount(upgradeRequire)) { Lable_count.SetText(NGUIColor.SetTxtColor(upgradeRequire.Count, TextColor.green)); } else { Lable_count.SetText(NGUIColor.SetTxtColor(upgradeRequire.Count, TextColor.red)); } } else { if (upgradeRequire.Count <= ContainerInfomanager.Instance.GetOwnMaterialCount(upgradeRequire)) { Lable_count.SetText(NGUIColor.SetTxtColor(ContainerInfomanager.Instance.GetOwnMaterialCount(upgradeRequire) + "/" + upgradeRequire.Count, TextColor.green)); } else { Lable_count.SetText(NGUIColor.SetTxtColor(ContainerInfomanager.Instance.GetOwnMaterialCount(upgradeRequire) + "/" + upgradeRequire.Count, TextColor.red)); } } }
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); } }