using System.Collections.Generic;
|
using UnityEngine;
|
|
public class ItemCost
|
{
|
public int itemId;
|
public int costNum;
|
|
public ItemCost(int _itemId, int _costNum)
|
{
|
itemId = _itemId;
|
costNum = _costNum;
|
}
|
|
public static List<ItemCost> GetList(int[] array)
|
{
|
List<ItemCost> retList = new List<ItemCost>();
|
|
if (array.Length % 2 != 0)
|
{
|
Debug.LogError("ItemCost.GetList Failure, because array % 2 != 0");
|
return retList;
|
}
|
|
for (int i = 0; i < array.Length; i += 2)
|
{
|
retList.Add(new ItemCost(array[i], array[i+1]));
|
}
|
|
return retList;
|
}
|
}
|