少年修仙传客户端代码仓库
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, October 30, 2018
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using TableConfig;
 
namespace Snxxz.UI {
    //功能预告第三部
 
    public class FeaturesType3:MonoBehaviour {
        [SerializeField] ImageEx m_Image_Selected;//底板
        [SerializeField] ImageEx m_Img_Circle;//Icon框
        [SerializeField] ImageEx m_FeaturesTypeIcon;//Icon
        [SerializeField] Text m_FunctionName;//功能名
        [SerializeField] Text m_FunctionalLevel;//功能等级
        [SerializeField] Text m_Content;//内容
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        public void GetTheFeatureID(int funcId)
        {
            var functionForecastConfig = Config.Instance.Get<FunctionForecastConfig>(funcId);
            if (functionForecastConfig == null)
            {
                return;
            }
            m_FunctionalLevel.text = functionForecastConfig.DisplayLevel.ToString() + Language.Get("Z1041");
            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_FunctionName.text = "?";
                m_FeaturesTypeIcon.SetSprite("UnKnowIcon");
                m_Content.text= string.Format(Language.Get("YGFuncLevel"), NeedLv, PlayerDatas.Instance.baseData.LV, NeedLv);
            }
            else
            {
                m_FunctionName.text = functionForecastConfig.FuncName;
                m_FeaturesTypeIcon.SetSprite(functionForecastConfig.FuncIconKey);
                m_Content.text = functionForecastConfig.Content;
            }
            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_Image_Selected.gray = false;
                m_Img_Circle.gray = false;
                m_FeaturesTypeIcon.gray = false;
            }
            else
            {
                m_Image_Selected.gray = true;
                m_Img_Circle.gray = true;
                m_FeaturesTypeIcon.gray = true;
            }
        }
    }
 
}