Exemplo n.º 1
0
        public void Setup(CharacterTemplate character)
        {
            _galleryItems.Clear();

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

            foreach (var skill in character.skills)
            {
                _galleryItems.AddNew().Setup(skill);
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 public void Setup(CharacterTemplate selectedFighter)
 {
     UpdateCharacterDetails(selectedFighter);
 }
Exemplo n.º 4
0
 public void Initialize(CharacterTemplate template)
 {
     _button.onClick.AddListener(() => Clicked?.Invoke(template));
     _avatar.sprite = template.avatar;
 }