少年修仙传客户端代码仓库
hch
3 天以前 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using vnxbqy.UI;
using System.Collections.Generic;
using UnityEngine.UI;
 
public class EnvRankCell : ILBehaviour
{
    Image BG1;
    Image BG2;
    Text Txt_Rank;
    Image RankNumBottom;
    Text Txt_Name;
    Text Txt_Compare;
 
    RankModel rankModel { get { return ModelCenter.Instance.GetModelEx<RankModel>(); } }
    protected override void Awake() 
    {
        Txt_Rank = proxy.GetWidgtEx<Text>("Txt_Rank");
        BG1 = proxy.GetWidgtEx<Image>("BG1");
        BG2 = proxy.GetWidgtEx<Image>("BG2");
        RankNumBottom = proxy.GetWidgtEx<Image>("RankNumBottom");
        Txt_Name = proxy.GetWidgtEx<Text>("Txt_Name");
        Txt_Compare = proxy.GetWidgtEx<Text>("Txt_Compare");
    }
 
 
    //index档位字典的数组索引
    public void Display(int index)
    {
        BG1.SetActiveIL(index % 2 == 0);
        BG2.SetActiveIL(index % 2 == 1);
        if (index < 3)
        {
            RankNumBottom.SetActiveIL(true);
            Txt_Rank.SetActiveIL(false);
            RankNumBottom.SetSprite(index == 0 ? "Rank_First" : index == 1 ? "Rank_Second" : "Rank_Third");
        }
        else
        {
            RankNumBottom.SetActiveIL(false);
            Txt_Rank.SetActiveIL(true);
            Txt_Rank.text = (index + 1).ToString();
        }
 
        List<RankData> rankDatas = null;
        rankModel.TryGetRanks((int)RankType.default3, out rankDatas);
 
        Txt_Name.text = rankDatas[index].name1;
        Txt_Compare.text = rankDatas[index].cmpValue.ToString();
    }
 
}