void LoadItems(string itemFile) { if (itemFile != null && itemFile != "") { using (StreamReader sr = new StreamReader(itemFile)) { // read const tableConst = TableReader.ItemConst_Read(sr.ReadLine); } editAbillR = new DicAbilityRate(tableConst.abillR); using (StreamReader sr = new StreamReader(itemFile)) { // read item tItemDict = TableReader.DictItem_Read(sr.ReadLine); } } int k = itemFile.IndexOf("Assets/"); if (k > 0) { itemFile = itemFile.Substring(k, itemFile.Length - k); } itemAsset = (TextAsset)AssetDatabase.LoadAssetAtPath(itemFile, typeof(TextAsset)); }
int CaleCost100(TableItem item, TableConstDic tc) { int totalw = 0; totalw += item.genShield * tc.abillR[ItemAbility.genShield]; totalw += item.genEnergy * tc.abillR[ItemAbility.genEnergy]; totalw += item.capShield * tc.abillR[ItemAbility.capShield]; totalw += item.capEnergy * tc.abillR[ItemAbility.capEnergy]; totalw += item.capStorage * tc.abillR[ItemAbility.capStorage]; totalw += item.capAccel * tc.abillR[ItemAbility.capAccel]; totalw += item.capSpeed * tc.abillR[ItemAbility.capSpeed]; totalw += tc.skillW[(ItemSkill)item.skill] * 100; return(totalw); }