Пример #1
0
    private void UpdateMenu()
    {
        itemLabels = new List <GameObject>();
        foreach (QueuedBlobby b in queuedBlobbies)
        {
            BuildingItemLabel item = Instantiate(blobListItemPrefab);
            item.SetBuildItem(blobbySprite, b.Color, b.Name, b.PercentComplete());
            itemLabels.Add(item.gameObject);
            b.Label = item;
        }

        for (int i = 0; i < queueLength - queuedBlobbies.Count; i++)
        {
            ShopItemLabel item = Instantiate(shopListItemPrefab);
            item.SetShopItem(0, this, this);
            itemLabels.Add(item.gameObject);
        }

        bool isToggleUp = hud.ToggleMenu(Menu.Spawner, itemLabels);

        if (!isToggleUp)
        {
            CleanGameObjectRefs();
        }
    }
Пример #2
0
    public void ToggleShoppingList()
    {
        List <GameObject> itemList = new List <GameObject>();
        int i = 0;

        foreach (GameObject item in shopItemPrefabs)
        {
            ShopItemLabel label    = Instantiate(shopItemLabelPrefab);
            IShopItem     shopItem = item.GetComponent <IShopItem>();
            label.SetShopItem(i++, shopItem, this);
            itemList.Add(label.gameObject);
        }

        hud.ToggleMenu(Menu.Shop, itemList);
        sound.PlayDrawerClip();
    }