少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using UnityEngine.UI;
using UnityEngine;
using vnxbqy.UI;
using System.Collections.Generic;
 
public class ArenaRewardCell : ILBehaviour
{
    
    Image rankImgBg;
    Text rankNumText;
    ItemCell m_ItemCell;
 
    protected override void Awake()
    {
        rankImgBg = proxy.GetWidgtEx<Image>("RankNumBottom");
        rankNumText = proxy.GetWidgtEx<Text>("RankNum");
        m_ItemCell = proxy.GetWidgtEx<ItemCell>("ItemCell");        
    }
  
    public void Display(int index)
    {
        rankImgBg.SetActiveIL(index < 3);
        rankNumText.SetActiveIL(index >= 3);
        rankNumText.text = (index + 1).ToString();
        if (index < 3)
        {
            rankImgBg.SetSprite(index == 0 ? "Rank_First" : index == 1 ? "Rank_Second" : "Rank_Third");
        }
        else
        {
            if (ArenaModel.Instance.SelectRewardType == 1)
            {
                if (index == ArenaManager.dayAwardTypelist.Count - 1)
                {
                    rankNumText.text = Language.Get("DemonJar13");
                }
                else
                {
                    int first = ArenaManager.dayAwardTypelist[index - 1].num + 1;
                    int last = ArenaManager.dayAwardTypelist[index].num;
                    if (first == last)
                    {
                        rankNumText.text = first.ToString();
                    }
                    else
                    { 
                        rankNumText.text = first.ToString() + "-" + last.ToString();
                    }
                }
            }
            else
            {
                if (index == ArenaManager.seasonAwardTypelist.Count - 1)
                {
                    rankNumText.text = Language.Get("DemonJar13");
                }
                else
                {
                    int first = ArenaManager.seasonAwardTypelist[index - 1].num + 1;
                    int last = ArenaManager.seasonAwardTypelist[index].num;
                    if (first == last)
                    {
                        rankNumText.text = first.ToString();
                    }
                    else
                    { 
                        rankNumText.text = first.ToString() + "-" + last.ToString();
                    }
                }
            }
        }
 
        int m_ItemID = 0;
        int m_Count = 0;
        if (ArenaModel.Instance.SelectRewardType == 1)
        {
            m_ItemID = ArenaManager.dayAwardTypelist[index].awardItems[0].itemId;
            m_Count = ArenaManager.dayAwardTypelist[index].awardItems[0].itemCount;
            m_ItemCell.Init(new ItemCellModel(m_ItemID, false, (ulong)m_Count));
            m_ItemCell.button.AddListener(() => ItemTipUtility.Show(m_ItemID));
        }
        else
        {
            //赛季奖励
            m_ItemID = ArenaManager.seasonAwardTypelist[index].awardItems[0].itemId;
            m_Count = ArenaManager.seasonAwardTypelist[index].awardItems[0].itemCount;
            m_ItemCell.Init(new ItemCellModel(m_ItemID, false, (ulong)m_Count));
            m_ItemCell.button.AddListener(() => ItemTipUtility.Show(m_ItemID));
        }
        
    }    
}