GetPrice() public méthode

public GetPrice ( ) : int
Résultat int
Exemple #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);
            }
        }
Exemple #2
0
        private void UpdatePrice()
        {
            if (IsUnlocked)
            {
                return;
            }

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

            if (price == null)
            {
                return;
            }

            this.priceText.text = price.Amount.ToString();
        }
Exemple #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();
        }
Exemple #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);
        }