少年修仙传客户端代码仓库
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using vnxbqy.UI;
 
 
namespace EnhancedUI.EnhancedScroller
{
    
    public class GodWeaponCell : CellView
    {
        [SerializeField] Text m_Level;
        [SerializeField] RectTransform m_ContainerUnlock;
        [SerializeField] Text m_Condition;
        [SerializeField] Image m_SelectBottom;
        [SerializeField] Image m_Icon;
        [SerializeField] Text m_GodWeaponName;
        [SerializeField] RedpointBehaviour m_Redpoint;
 
        MagicianModel m_Model;
        MagicianModel model
        {
            get
            {
                return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<MagicianModel>());
            }
        }
        public void Display(int _type)
        {
            m_SelectBottom.SetSprite(model.selectType == _type ? "ListBtn_Select" : "ListBtn_UnSelect");
            var config = GodWeaponConfig.GetConfig(_type, 1);
            m_GodWeaponName.text = config.Name;
            var godWeaponInfo = model.GetGodWeaponInfo(_type);
            m_Level.SetActive(godWeaponInfo != null && godWeaponInfo.level >= 1);
            m_Level.text = StringUtility.Contact(godWeaponInfo.level, Language.Get("L1047"));
            m_ContainerUnlock.SetActive(godWeaponInfo == null || godWeaponInfo.level < 1);
            m_Redpoint.redpointId = MagicianModel.MAGICAIN_REDPOINT * MagicianModel.MAGICAIN_INTERVAL + _type;
 
            if (!model.IsGodWeaponUnlock(_type))
            {
                bool satisfyCondition = model.ContainsCondition(_type) && model.SatisfyUnlockCondition(_type);
                m_Condition.text = satisfyCondition ? Language.Get("GodWeaponUnActive") : Language.Get("MagicWin_1");
            }
            if (model.godWeaponIcons.ContainsKey(_type))
            {
                m_Icon.SetSprite(model.godWeaponIcons[_type]);
                m_Icon.SetNativeSize();
            }
        }
    }
}