Exemple #1
0
        public void Setup(CharacterTemplate character)
        {
            _galleryItems.Clear();

            if (character?.skills == null)
            {
                return;
            }

            foreach (var skill in character.skills)
            {
                _galleryItems.AddNew().Setup(skill);
            }
        }
        private void UpdateCharacterDetails(CharacterTemplate character)
        {
            if (character == null)
            {
                _statsContainer.SetActive(false);

                _avatar.sprite  = _nothingSelectedAvatar;
                _nameLabel.text = "";
            }
            else
            {
                _statsContainer.SetActive(true);
                _hpLabel.text = $"HP: {character.hp}";

                _avatar.sprite  = character.avatar;
                _nameLabel.text = character.name;
            }
        }
 public void Setup(CharacterTemplate selectedFighter)
 {
     UpdateCharacterDetails(selectedFighter);
 }
Exemple #4
0
 public void Initialize(CharacterTemplate template)
 {
     _button.onClick.AddListener(() => Clicked?.Invoke(template));
     _avatar.sprite = template.avatar;
 }