示例#1
0
    // Cost Item
    public Dictionary <int, int> GetCostsItems()
    {
        if (m_Item == null)
        {
            return(null);
        }

        Dictionary <int, int> costItems = new Dictionary <int, int>();

        MaterialItem[] kvpList = m_Item.GetMaterialItems();
        if (kvpList == null)
        {
            return(null);
        }

        foreach (MaterialItem kvp in kvpList)
        {
            costItems[kvp.protoId] = Mathf.CeilToInt(kvp.count);
        }
        return(costItems);

        //if (m_Item.instanceId > CreationData.s_ObjectStartID)
        //{
        //    Dictionary<int, int> costItems = new Dictionary<int, int>();
        //    foreach (KeyValuePair<int, int> kvp in m_Item.prototypeData.mRepairRequireList)
        //    {
        //        if (kvp.Key > 30200000 && kvp.Key < 30300000)
        //            costItems[kvp.Key] = Mathf.CeilToInt(kvp.Value);
        //    }
        //    return costItems;
        //}
        //else
        //    return m_Item.prototypeData.mStrengthenRequireList;
    }