void Start() { if (this != null) { menu = GameObject.Find("Main Canvas").GetComponent <MenuManager>(); if (JsonFile.save.Shops.shopEnabled.ContainsKey(shopIdentifier)) { Enabled = JsonFile.save.Shops.shopEnabled[shopIdentifier]; } else { JsonFile.save.Shops.shopEnabled.Add(shopIdentifier, true); } if (Enabled) { CreateItemObject itmobj = GetComponent <CreateItemObject>(); if (itmobj != null) { itmobj.AddItems(); Enabled = false; JsonFile.save.Shops.shopEnabled[shopIdentifier] = Enabled; SaveData.queueSave = true; } SaveInventory(); } else { GetInventory(); } } }
public void CreateLoot(GameObject lootSlotObject, Image uiSprite) { Loot loot = lootSlotObject.GetComponent <Loot>(); loot.attachedItem = CreateItemObject.GenerateItemObject( CreateItemObject.Generate( itemObjectDatabase.ItemList[RandomManager.random.Next( itemObjectDatabase.ItemList.Count)])); loot.itemAttached = true; AddItemToInventory(loot.attachedItem, uiSprite); }