//--------------------------------------------------------
|
// [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;
|
}
|
}
|
}
|
|
}
|