public static int QueryBattleGain(int level) { if ((level <= 0) || (level > 4)) { return(0); } TouchLevelItem item = null; int num = 0; int count = _touchLevelItemList.Count; while (num < count) { if (_touchLevelItemList[num].level == level) { item = _touchLevelItemList[num]; break; } num++; } if (item == null) { return(0); } return(item.battleGain); }
public static int QueryLevelUpFeelNeedTouch(int level) { if ((level <= 0) || (level > 4)) { return(0); } TouchLevelItem item = null; int num = 0; int count = _touchLevelItemList.Count; while (num < count) { if (_touchLevelItemList[num].level == level) { item = _touchLevelItemList[num]; break; } num++; } if (item == null) { return(0); } float num3 = item.touchExp * item.rate; return(item.touchExp - ((int)num3)); }
private static void LoadTouchLevelData() { List <string> list = new List <string>(); TextAsset asset = Miscs.LoadResource("Data/_ExcelOutput/TouchLevelData", BundleType.DATA_FILE) as TextAsset; char[] separator = new char[] { "\n"[0] }; string[] strArray = asset.text.Split(separator); for (int i = 0; i < strArray.Length; i++) { if (strArray[i].Length >= 1) { list.Add(strArray[i]); } } int capacity = list.Count - 1; _touchLevelItemList = new List <TouchLevelItem>(capacity); for (int j = 1; j <= capacity; j++) { char[] chArray2 = new char[] { "\t"[0] }; string[] strArray2 = list[j].Split(chArray2); TouchLevelItem item = new TouchLevelItem { level = int.Parse(strArray2[0]), touchExp = int.Parse(strArray2[1]), prop = float.Parse(strArray2[2]), rate = float.Parse(strArray2[3]), battleGain = int.Parse(strArray2[4]) }; _touchLevelItemList.Add(item); } }