GetPrice() public method

public GetPrice ( ) : int
return int
Exemplo n.º 1
0
        private void SetupPrice()
        {
            var price = Skill.GetPrice().FirstOrDefault();

            if (price != null)
            {
                this.priceIcon.sprite = Resources.Load <Sprite>(price.Icon);
                UpdatePrice();
            }
            else
            {
                this.priceText.gameObject.SetActive(false);
                this.priceIcon.gameObject.SetActive(false);
            }
        }
Exemplo n.º 2
0
        private void UpdatePrice()
        {
            if (IsUnlocked)
            {
                return;
            }

            var price = Skill.GetPrice().FirstOrDefault();

            if (price == null)
            {
                return;
            }

            this.priceText.text = price.Amount.ToString();
        }
Exemplo n.º 3
0
        public void Initialize(Skill skill)
        {
            Skill = skill;

            this.icon.sprite   = Resources.Load <Sprite>(skill.Icon);
            this.nameText.text = skill.Name;

            var price = skill.GetPrice().FirstOrDefault();

            if (price != null)
            {
                this.priceText.text   = price.Amount.ToString();
                this.priceIcon.sprite = Resources.Load <Sprite>(price.Icon);
            }
            else
            {
                this.priceContainer.gameObject.SetActive(false);
            }

            Deselect();
        }
Exemplo n.º 4
0
        private void OnSkillBuyed(Skill skill)
        {
            if (this.spellbook.Skills.Any(unlocked => unlocked.Id == skill.Id))
            {
                return;
            }

            try
            {
                this.currencies.Withdraw(skill.GetPrice());
            }
            catch (GameplayException exception)
            {
                UiErrorFrame.Instance.Push(exception.Message);
                return;
            }

            this.spellbook.Add(skill);

            UpdateSkillPriceMultipliers();

            View.UnlockSkill(skill);
        }