using System; using System.Collections.Generic; using BrewMonster.Network; using UnityEngine; using UnityEngine.UI; namespace BrewMonster { public class SkillSetUpComboWidget : MonoBehaviour { [SerializeField] private List _combosList; [SerializeField] private Button _btnEditCombo; [SerializeField] private Button _btnDeleteCombo; [Header("SetUpCombo")] [SerializeField] private GameObject _contentSetUpCombo; [SerializeField] private Image _imgCurrentCombo; [SerializeField] private List _detailCombosList; [SerializeField] private Button _btnConfirmCombo; private void OnEnable() { ShowCurrentCombos(); } private void ShowCurrentCombos() { var m_nIcon = 1; EC_VIDEO_SETTING setting = EC_Game.GetConfigs().GetVideoSettings(); // setting.comboSkill[GetData() - 1].nIcon = (byte)m_nIcon; if (_combosList.Count != setting.comboSkill.Length) { BMLogger.LogError("Combo list size mismatch"); return; } for (int i = 0; i < setting.comboSkill.Length; i++) { // m_IconMap[(byte)iCONS_TYPE].Item2.FirstOrDefault(s => s.name == nameImage) if (setting.comboSkill[i].idSkill.Length > 0) { if (IsAnEmptyCombo(setting.comboSkill[i].idSkill)) { _combosList[i].SetImage(null); } else { } } } } private bool IsAnEmptyCombo(short[] idSkills) { bool isValid = false; foreach (var id in idSkills) { if (id !=0) { return true; } } return isValid; } } }