少年修仙传客户端代码仓库
client_Wu Xijin
2019-06-13 033958214c0b16d7e7b93cc821b018c295251867
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, March 12, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
 
    public class TipEquipBaseInfoWidget : MonoBehaviour
    {
        [SerializeField] ImageEx m_Label;
        [SerializeField] Text m_ItemName;
        [SerializeField] ItemBehaviour m_Item;
        [SerializeField] Text m_ScoreOrType;
        [SerializeField] RectTransform m_RealmContainer;
        [SerializeField] Image m_Realm;
        [SerializeField] RectTransform m_SurplusTimeContainer;
        [SerializeField] Text m_SurplusTime;
        [SerializeField] Text m_Star;
 
        public void Display(ItemTipUtility.BaseInfo baseInfo)
        {
            if (baseInfo.isEquiped)
            {
                m_Label.gameObject.SetActive(true);
                m_Label.SetSprite("Equiped_a");
                m_Label.gray = false;
                m_Star.text = baseInfo.star >= 1 ? string.Format("{0}星", baseInfo.star) : "";
            }
            else if (baseInfo.isAuction)
            {
                m_Label.gameObject.SetActive(true);
                m_Label.SetSprite("Item_Auction_2");
                m_Label.gray = baseInfo.auctionSurplusTime <= 0;
                m_Star.text = "";
            }
            else
            {
                m_Star.text = "";
                m_Label.gameObject.SetActive(false);
            }
 
            var itemConfig = ItemConfig.Get(baseInfo.itemId);
            var strengthenPostfix = baseInfo.strengthenLevel > 0 ? string.Format("+{0}", baseInfo.strengthenLevel) : "";
            if (itemConfig.SuiteiD > 0)
            {
                var setName = UIHelper.AppendColor(TextColType.Green, EquipModel.GetSuitName(itemConfig.LV));
                var itemNeme = UIHelper.AppendColor(itemConfig.ItemColor, itemConfig.ItemName + strengthenPostfix);
                m_ItemName.text = setName + itemNeme;
            }
            else
            {
                m_ItemName.text = itemConfig.ItemName + strengthenPostfix;
                m_ItemName.color = UIHelper.GetUIColor(itemConfig.ItemColor);
            }
 
            m_Item.SetItem(baseInfo.itemId, 1);
 
            if (baseInfo.score != 0)
            {
                if (!baseInfo.isPreview && !baseInfo.isAuction)
                {
                    m_ScoreOrType.text = Language.Get("EquipWin_EquipPointText_1") + baseInfo.score;
                }
                else
                {
                    m_ScoreOrType.text = Language.Get("EquipWin_EquipPointText_2") + baseInfo.score;
                }
            }
            else
            {
                m_ScoreOrType.text = itemConfig.ItemTypeName;
            }
 
            if (itemConfig.RealmLimit > 0 && RealmConfig.Has(itemConfig.RealmLimit))
            {
                m_RealmContainer.gameObject.SetActive(true);
                var realmConfig = RealmConfig.Get(itemConfig.RealmLimit);
                m_Realm.SetSprite(realmConfig.Img);
            }
            else
            {
                m_RealmContainer.gameObject.SetActive(false);
            }
 
            if (baseInfo.isAuction)
            {
                m_SurplusTimeContainer.gameObject.SetActive(true);
                if (baseInfo.auctionSurplusTime > 0)
                {
                    m_SurplusTime.text = TimeUtility.SecondsToHMSCHSRetain(baseInfo.auctionSurplusTime);
                }
                else
                {
                    m_SurplusTime.text = "已过期";
                }
            }
            else
            {
                m_SurplusTimeContainer.gameObject.SetActive(false);
            }
 
        }
 
    }
 
}