少年修仙传客户端代码仓库
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, September 11, 2018
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
 
//功能开启类型2
namespace vnxbqy.UI {
 
    public class FeaturesType2:MonoBehaviour {
        [SerializeField] Text m_FunctionalLevel;//功能等级
        [SerializeField] Text m_FunctionName;//功能名
        [SerializeField] ImageEx m_FeaturesTypeIcon;//功能图标
        [SerializeField] GameObject m_ImageSelected;
        [SerializeField] Button m_Button;
        [SerializeField] GameObject m_DefaultBar;
        [SerializeField] GameObject m_SelectedBar;
        [SerializeField] GameObject m_Img_Done;
        [SerializeField] ImageEx m_NameBottom;
        public GameObject ImageSelected
        {
            get { return m_ImageSelected; }
            set { m_ImageSelected = value; }
        }
        public Button Button
        {
            get { return m_Button; }
            set { m_Button = value; }
        }
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        public void GetTheFeatureID(int funcId)
        {
            var functionForecastConfig = FunctionForecastConfig.Get(funcId);
            if (functionForecastConfig == null)
            {
                return;
            }
           
            m_FunctionalLevel.text = Language.Get("LoadIconLV", functionForecastConfig.DisplayLevel);
            bool  Type = false;
            int NeedLv = 0;
            int playerLv = PlayerDatas.Instance.baseData.LV;
            if (functionForecastConfig.OpenNumber - 2 >= featureNoticeModel.FunctionForecastIndex)
            {
                Type = true;
                NeedLv = featureNoticeModel.GetOpenLv(functionForecastConfig.OpenNumber - 2);
            }
            if (!FuncOpen.Instance.IsFuncOpen(funcId) && Type && NeedLv> playerLv)
            {
                m_FeaturesTypeIcon.SetSprite("UnKnowIcon");
                m_FunctionName.text = "?";
            }
            else
            {
                m_FunctionName.text = functionForecastConfig.FuncName;
                m_FeaturesTypeIcon.SetSprite(functionForecastConfig.FuncIconKey);
            }
            if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.DisplayLevel)
            {
                m_FunctionalLevel.color = new Color32(141, 220, 17,255);
            }
            else
            {
                m_FunctionalLevel.color = new Color32(255, 244, 205,255);
            }
            if (FuncOpen.Instance.IsFuncOpen(funcId))
            {
                m_SelectedBar.SetActive(true);
                m_Img_Done.SetActive(true);
                m_FeaturesTypeIcon.gray = false;
                m_NameBottom.gray = false;
                m_FunctionName.color = new Color(255, 244, 205);
            }
            else
            {
                m_SelectedBar.SetActive(false);
                m_Img_Done.SetActive(false);
                m_FeaturesTypeIcon.gray = true;
                m_NameBottom.gray = true;
                m_FunctionName.color = new Color(255, 244, 205);
            }
        }
 
 
    }
 
}