void InstantiateSalesItems() { GrottoSpawnPoint gsp = GrottoSpawnPoint; for (int i = 0; i < gsp.SaleItemPrefabs.Count; i++) { Collectible cPrefab = gsp.SaleItemPrefabs[i]; SaleItemView v = _saleItemViews[i]; // TODO: Instantiate these dynamically if (cPrefab == null || v == null) { continue; } cPrefab.riseUpWhenCollected = false; int price = gsp.SaleItemPrices[i]; string cName = cPrefab.itemPrefab.name; Item item = Inventory.Instance.GetItem(cName); if (!item.IsMaxedOut) { Collectible c = Grotto.InstantiateItem(cPrefab.gameObject, v.transform, price); c.name = cName; _salesItems.Add(c); } string priceText = price.ToString(); v.UpdatePriceText(priceText); v.gameObject.SetActive(!item.IsMaxedOut); } }
void ShowTheUniqueItem(bool doShow = true) { if (_uniqueCollectibleItem == null) { _uniqueCollectibleItem = Grotto.InstantiateItem(UniqueCollectiblePrefab.gameObject, _uniqueItemContainer); } _uniqueItemContainer.gameObject.SetActive(doShow); }
void ShowGift(bool doShow = true) { if (_giftItem == null) { Collectible c = GiftPrefab; if (c != null) { _giftItem = Grotto.InstantiateItem(c.gameObject, _giftContainer); } } _giftTextDisplay.Text = GiftAmount.ToString(); _giftContainer.gameObject.SetActive(doShow); }