Exemplo n.º 1
0
        // Use this for initialization
        void Start()
        {
            playerItemManager = FindObjectOfType <PlayerItemManager>();
            BuyButton.onClick.AddListener(BuyItem);
            itemsLoaded = false;

            //ItemDescriptionTextBox.text = inventory. .SelectedSlot.Items.Peek(). itemsForSale.ItemTitle + "\n" + itemsForSale[i].ItemDescription + "\n Gold: " + itemsForSale[i].ItemCost;
        }
        // Use this for initialization
        void Start()
        {
            shopUIExists = false;

            playerItemManager = FindObjectOfType <PlayerItemManager>();
            BuyButton.onClick.AddListener(BuyItem);
            itemsLoaded = false;

            if (!shopUIExists)
            {
                shopUIExists = true;
                DontDestroyOnLoad(transform.gameObject);
            }
            else
            {
                Destroy(gameObject);
            }

            for (int i = 0; i < itemsForSale.Count; i++)
            {
                ItemTextBox[i].text = itemsForSale[i].ItemTitle + "\n" + itemsForSale[i].ItemDescription + "\n Gold: " + itemsForSale[i].ItemCost;
            }
        }