少年修仙传客户端代码仓库
client_Wu Xijin
2019-04-16 fc714208ff3a320c3bb52bddd5ea3d91f647a206
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
namespace Snxxz.UI
{
    public class TrialExchangeCell : CellView
    {
        [SerializeField] TrialExchangeBehaviour[] m_TrialExchanges;
 
        TrialDungeonModel model { get { return ModelCenter.Instance.GetModel<TrialDungeonModel>(); } }
 
        public void Display(int _class, int _line)
        {
            List<TrialExchangeConfig> 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 * 3 + i;
                if (index < list.Count)
                {
                    m_TrialExchanges[i].gameObject.SetActive(true);
                    m_TrialExchanges[i].Display(list[index].id, _betterEquipId == list[index].id, (_line + i) == 0);
                }
                else
                {
                    m_TrialExchanges[i].gameObject.SetActive(false);
                }
            }
        }
    }
}