using System.Collections; using System.Collections.Generic; using TableConfig; using UnityEngine; namespace Snxxz.UI { public class TrialExchangeCell : CellView { [SerializeField] TrialExchangeBehaviour[] m_TrialExchanges; TrialDungeonModel model { get { return ModelCenter.Instance.GetModel(); } } public void Display(int _class, int _line) { List list; if (!model.TryGetTrialExchanges(_class, out list)) { return; } int _betterEquipId = -1; model.IsAnySatisfyExchangeBetterEquip(_class, out _betterEquipId); for (int i = 0; i < m_TrialExchanges.Length; i++) { var index = _line * 4 + i; if (index < list.Count) { m_TrialExchanges[i].gameObject.SetActive(true); m_TrialExchanges[i].Display(list[index].id, _betterEquipId == list[index].id); } else { m_TrialExchanges[i].gameObject.SetActive(false); } } } } }