少年修仙传客户端代码仓库
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, December 19, 2018
//--------------------------------------------------------
using EnhancedUI.EnhancedScroller;
using System.Collections;
using System.Collections.Generic;
using TableConfig;
using UnityEngine;
using UnityEngine.UI;
using System;
 
namespace Snxxz.UI {
 
    public class RankCellCtrl : ScrollerUI
    {
        [SerializeField] Button m_RankButton;
        [SerializeField] Text m_RankNum;
        [SerializeField] Image m_RankNumBottom;
        [SerializeField] Text m_NameTxt;
        [SerializeField] Text m_JobTxt;
       // [SerializeField] Text m_RankWhatTxt;
        [SerializeField] Text m_SegmentTxt;
        [SerializeField] Text m_IntegralTxt;
        [SerializeField] Image m_RealmImage;
        CrossServerRewardModel m_CrossServerRewardModel;
        CrossServerRewardModel crossServerRewardModel { get { return m_CrossServerRewardModel ?? (m_CrossServerRewardModel = ModelCenter.Instance.GetModel<CrossServerRewardModel>()); } }
        RoleParticularModel roleParticularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
        public override void Refresh(CellView cell)
        {
            int index = cell.index;
            if (index < 3)
            {
                m_RankNumBottom.gameObject.SetActive(true);
                if (index == 0)
                {
                    m_RankNumBottom.SetSprite("Rank_First");
                }
                else if (index == 1)
                {
                    m_RankNumBottom.SetSprite("Rank_Second");
                }
                else if (index == 2)
                {
                    m_RankNumBottom.SetSprite("Rank_Third");
                }
                m_RankNum.gameObject.SetActive(false);
            }
            else
            {
                m_RankNumBottom.gameObject.SetActive(false);
                m_RankNum.text = (index + 1).ToString();
                m_RankNum.gameObject.SetActive(true);
            }
            m_RealmImage.gameObject.SetActive(false);
            RankingInformationClass data = null;
            ZoneRankingStruct zoneRanking = new ZoneRankingStruct();
            zoneRanking.ZoneID= crossServerRewardModel.ZoneID;
            zoneRanking.SeasonID = crossServerRewardModel.SeasonID;
            Dictionary<int, RankingInformationClass> rankDic = new Dictionary<int, RankingInformationClass>();
            if (crossServerRewardModel.ZoneRankingDic.ContainsKey(zoneRanking))
            {
                rankDic = crossServerRewardModel.ZoneRankingDic[zoneRanking];
            }
            if (rankDic != null && index < rankDic.Count)
            {
                data = rankDic[index];
            }
            if (data != null)
            {
                m_RankButton.SetListener(()=> 
                {
                    //DebugEx.LogError(data.PlayerID);
                    roleParticularModel.ViewFairyCrossServerOneVsOne(data.PlayerID);
                });
                m_NameTxt.text = data.PlayerName;
                m_JobTxt.text = OccupationNameConfig.GetOccupationName(data.Job, 1);
                RealmConfig presentCfg = Config.Instance.Get<RealmConfig>(data.Realm);
                if (presentCfg != null)
                {
                    m_RealmImage.gameObject.SetActive(true);
                    m_RealmImage.SetSprite(presentCfg.Img);
                }
              //  m_RankWhatTxt.text = data.Power.ToString();
                Segment(data.DanLv);
                m_IntegralTxt.text = data.PkScore.ToString();
            }
            else
            {
                m_NameTxt.text = Language.Get("L1046");
                m_JobTxt.text = "-";
              //  m_RankWhatTxt.text = "-";
                m_SegmentTxt.text= "-";
                m_IntegralTxt.text= "-";
 
                m_NameTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                m_JobTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
               // m_RankWhatTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                m_SegmentTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
                m_RankButton.RemoveAllListeners();
            }
        }
 
        private void  Segment(int Danlv)
        {
            var config = Config.Instance.Get<CrossServerArenaConfig>(Danlv);
            m_SegmentTxt.text = config.Name;
            m_SegmentTxt.color= UIHelper.GetDanLVColor(Danlv, false);
            //if (Danlv >= 24)
            //{
            //    m_SegmentTxt.color = new Color32(255, 3, 3, 255);
            //}
            //else if (Danlv < 24 && Danlv > 15)
            //{
            //    m_SegmentTxt.color = new Color32(255, 103, 1, 255);
            //}
            //else if (Danlv < 15 && Danlv > 10)
            //{
            //    m_SegmentTxt.color = new Color32(218, 72, 213, 255);
            //}
            //else
            //{
            //    m_SegmentTxt.color = new Color32(104, 104, 104, 255);
            //}
        }
 
    }
 
   
}