// CONSTRUCTOR & UPDATER: -----------------------------------------------------------------

        public override void Setup(MerchantUIManager merchantUIManager, params object[] parameters)
        {
            base.Setup(merchantUIManager, parameters);
            this.ware = parameters[0] as Merchant.Ware;

            this.UpdateUI();
        }
Beispiel #2
0
        // PUBLIC METHODS: ------------------------------------------------------------------------

        public void UpdateUI(Merchant.Ware ware)
        {
            this.ware = ware;
            Item item = this.ware.item.item;

            int curAmount = MerchantManager.Instance.GetMerchantAmount(
                this.merchantUIManager.currentMerchant,
                ware.item.item
                );

            if (this.image != null && item.sprite != null)
            {
                this.image.sprite = item.sprite;
            }
            if (this.textName != null)
            {
                this.textName.text = item.itemName.GetText();
            }
            if (this.textDescription != null)
            {
                this.textDescription.text = item.itemDescription.GetText();
            }
            if (this.textPrice != null)
            {
                this.textPrice.text = item.price.ToString();
            }

            this.wrapAmount.SetActive(ware.limitAmount);
            if (this.textCurrentAmount != null)
            {
                this.textCurrentAmount.text = curAmount.ToString();
            }
            if (this.textMaxAmount != null)
            {
                this.textMaxAmount.text = ware.maxAmount.ToString();
            }

            this.canvasGroup.interactable = (
                InventoryManager.Instance.GetCurrency() >= item.price &&
                (!ware.limitAmount || curAmount > 0)
                );
        }
Beispiel #3
0
        // CONSTRUCTOR & UPDATER: -----------------------------------------------------------------

        public void Setup(Merchant.Ware ware, MerchantUIManager merchantUIManager)
        {
            this.merchantUIManager = merchantUIManager;
            this.UpdateUI(ware);
        }