Ejemplo n.º 1
0
    public static GameObject GetItemPrefab(ItemEnums item)
    {
        GameObject prefab = null;

        for (int i = 0; i < mItemPrefabs.Count; i++)
        {
            ItemFactoryData data = mItemPrefabs[i].GetComponent <ItemFactoryData>();
            if (data != null)
            {
                if (data.ItemEnum == item)
                {
                    prefab = mItemPrefabs[i];
                    break;
                }
            }
        }
        return(prefab);
    }
    void addItemToStock(ItemFactoryData itemtoAdd)
    {
        if (SharedResourceList.Count < 0)
        {
            return;
        }

        foreach (ItemFactoryData item in SharedResourceList)
        {
            if (itemtoAdd.ItemName == item.ItemName)
            {
                item.quantity += itemtoAdd.quantity;
                return;
            }
        }

        SharedResourceList.Add(itemtoAdd);
        return;
    }
Ejemplo n.º 3
0
 public ResourceDataSO(ItemFactoryData item, float value)
 {
     Item           = item;
     AbundanceValue = value;
 }
Ejemplo n.º 4
0
 public SerializedDictionaryEntry_ItemType(ItemFactoryData targetTemplate, float startingQuantity)
 {
     ItemType = targetTemplate;
     Value    = startingQuantity;
 }