public static List <float> GetAvatarMaxExpList(AvatarDataItem avatarData, int fromLevel, int toLevel) { List <float> list = new List <float>(); List <AvatarLevelMetaData> itemList = AvatarLevelMetaDataReader.GetItemList(); for (int i = fromLevel; i <= toLevel; i++) { list.Add((float)itemList[i - 1].exp); } return(list); }
private int CalculateLevelAfter(AvatarDataItem avatar, float addExp, out bool isAfterLevelMax) { int avatarLevelLimit = Singleton <PlayerModule> .Instance.playerData.AvatarLevelLimit; List <AvatarLevelMetaData> itemList = AvatarLevelMetaDataReader.GetItemList(); int num2 = Mathf.Min(itemList.Count, avatarLevelLimit); float num3 = addExp + avatar.exp; int level = avatar.level; while ((num3 > 0f) && (level < num2)) { if (itemList[level - 1].exp > num3) { break; } num3 -= itemList[level - 1].exp; level++; } isAfterLevelMax = ((num3 > 0f) && (level == num2)) && (itemList[level - 1].exp <= num3); return(level); }