public static int QueryTouchFeel(int avatarID, int partIndex, int heartLevel) { int num = GetTouchID(avatarID, partIndex, heartLevel); if (num == 0) { return(0); } TouchDataItem item = null; int num2 = 0; int count = _touchDataItemList.Count; while (num2 < count) { if (_touchDataItemList[num2].touchId == num) { item = _touchDataItemList[num2]; break; } num2++; } if (item == null) { return(0); } return(item.point); }
private static void LoadTouchData() { List <string> list = new List <string>(); TextAsset asset = Miscs.LoadResource("Data/_ExcelOutput/TouchData", 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; _touchDataItemList = new List <TouchDataItem>(capacity); for (int j = 1; j <= capacity; j++) { char[] chArray2 = new char[] { "\t"[0] }; string[] strArray2 = list[j].Split(chArray2); TouchDataItem item = new TouchDataItem { touchId = int.Parse(strArray2[0]), level = int.Parse(strArray2[1]), point = int.Parse(strArray2[2]) }; char[] chArray3 = new char[] { ',' }; string[] strArray3 = strArray2[3].Split(chArray3); item.buff = new int[strArray3.Length]; for (int k = 0; k < strArray3.Length; k++) { item.buff[k] = int.Parse(strArray3[k]); } _touchDataItemList.Add(item); } }