少年修仙传客户端代码仓库
lcy
2025-05-08 1314c3b3c14cd520bbb8569b5f98d68933a22cd3
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
using System.Linq;
using UnityEngine;
 
namespace vnxbqy.UI
{
    public class FairySiegeRankAwardActPersonalCell : CellView
    {
        [SerializeField] ImageEx imgBG;
        [SerializeField] ImageEx imgRank;
        [SerializeField] TextEx txtRank;
 
        [SerializeField] ImageEx imgTitle;
        [SerializeField] UIFrame uifTitle;
        [SerializeField] FairySiegeItemCellArr items;
        [SerializeField] TextEx txtNeedScore;
 
        FairySiegeActModel model { get { return ModelCenter.Instance.GetModel<FairySiegeActModel>(); } }
 
        public void Display(int index)
        {
            if (model.operationCrossAct == null)
                return;
            int personalTemplateID = model.operationCrossAct.PersonalTemplateID;
            var rankDict = BillboardAwardTempConfig.GetRankDict(personalTemplateID);
            if (rankDict == null)
                return;
            var list = rankDict.Keys.ToList();
            list.Sort();
            int id = rankDict[list[index]];
            if (!BillboardAwardTempConfig.Has(id))
                return;
            BillboardAwardTempConfig config = BillboardAwardTempConfig.Get(id);
            items.Display(config.AwardItemList);
 
            bool hasTitle = model.TryGetTitleId(config.AwardItemList, out int titleId);
            imgTitle.SetActive(hasTitle);
            if (hasTitle)
            {
                model.DisplayTitle(imgTitle, uifTitle, titleId);
            }
 
            if (index < 3)
            {
                imgRank.SetActive(true);
                imgRank.SetSprite("actrank" + (index + 1));
                imgRank.SetNativeSize();
                imgBG.SetSprite("actrankBG" + (index + 1));
            }
            else
            {
                imgRank.SetActive(false);
                imgBG.SetSprite("actrankBGOther");
            }
 
            var startRank = 1;
            if (index > 0)
            {
                startRank = list[index - 1] + 1;
            }
            var endRank = list[index];
            if (startRank == endRank)
            {
                txtRank.text = endRank.ToString();
            }
            else
            {
                txtRank.text = StringUtility.Contact(startRank, "-", endRank);
            }
 
            txtNeedScore.text = config.NeedValue == 0 ? string.Empty : Language.Get("FairySiege143", config.NeedValue);
        }
    }
}