public void Init(Characteristic characteristic, CharacterPage characterPage, int goldCost)
        {
            this._item          = characteristic;
            this._characterPage = characterPage;
            _goldCost           = goldCost;

            ValueText.text = characteristic.BaseValue.ToString();
        }
Esempio n. 2
0
        public void Setup(Character.Player currentItem, int currentIndex, CharacterPage currentCharacterPage, bool isSelected = false)
        {
            CharacterName.text = currentItem.Name;
            CoinText.text      = ((new System.Random()).Next(400)).ToString();
            SpellsText.text    = currentItem.Spells.Count.ToString();

            characterPage = currentCharacterPage;
            item          = currentItem;
            index         = currentIndex;
        }
        public void Init(Player character, CharacterPage characterPage)
        {
            _player = character;
            ModelSelection.onClick.AddListener(HandleClickSelectionIcon);

            CharacterName.text = character.Name;

            Health.Init(character.Attributes.Health, characterPage, 2);
            Armor.Init(character.Attributes.Armor, characterPage, 2);
            ManaPoints.Init(character.Attributes.ManaPoints, characterPage, 2);
            ActionPoints.Init(character.Attributes.ActionPoints, characterPage, 10);

            this.characterPage = characterPage;

            SelectionModel.Init(character, characterPage, this);
            UpdateIconPlayer();
        }
Esempio n. 4
0
        public void Setup(Spell currentItem, int currentIndex, CharacterPage currentCharacterPage)
        {
            _item          = currentItem;
            _characterPage = currentCharacterPage;
            _index         = currentIndex;

            SpellName.text = currentItem.Name;

            Damage.Init(currentItem.Attributes.Damage, currentCharacterPage, 10);
            Range.Init(currentItem.Attributes.Range, currentCharacterPage, 10);
            Radius.Init(currentItem.Attributes.Radius, currentCharacterPage, 10);
            Cooldown.Init(currentItem.Attributes.Cooldown, currentCharacterPage, -10);
            ManaCost.Init(currentItem.Attributes.ManaCost, currentCharacterPage, -10);

            var sprite = Resources.Load <Sprite>($"Sprites/SpellIcons/{currentItem.Icon}");

            if (sprite != null)
            {
                SpellIcon.GetComponent <Image>().sprite = sprite;
            }

            toggle.Setup(currentItem, currentCharacterPage);
        }