Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
0
 void ShowTheUniqueItem(bool doShow = true)
 {
     if (_uniqueCollectibleItem == null)
     {
         _uniqueCollectibleItem = Grotto.InstantiateItem(UniqueCollectiblePrefab.gameObject, _uniqueItemContainer);
     }
     _uniqueItemContainer.gameObject.SetActive(doShow);
 }
Esempio n. 3
0
 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);
 }