Esempio n. 1
0
    /// <summary>
    /// Updates shown text
    /// </summary>
    public IEnumerator UpdateUITexts()
    {
        yield return(new WaitForSeconds(Time.deltaTime));

        ShopTextController.itemName = selectedItem.name.Replace("Content", "");
        ShopTextController.SetUpgradeLevel(selectedUpgradeLevel);
        ShopTextController.UpdateTexts();
    }
Esempio n. 2
0
    /// <summary> When shop item is clicked, sets reference of selectedItem and make it active. </summary>
    /// <param name="item"></param>
    public void SelectItem(GameObject shopItem)
    {
        selectedUpgradeLevel = 1;
        ShopTextController.SetUpgradeLevel(selectedUpgradeLevel);

        foreach (var item in shopItems)
        {
            item.SetActive(false);
        }

        selectedItem = null;
        selectedItem = shopItem;
        StartCoroutine(UpdateUITexts());
        selectedItem.SetActive(true);
    }