//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, October 30, 2018
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
|
using System.Collections.Generic;
|
|
namespace vnxbqy.UI
|
{
|
|
public class FeaturesType3 : CellView
|
{
|
[SerializeField] ImageEx m_Image_Selected;//底板
|
[SerializeField] ImageEx m_FeaturesTypeIcon;//Icon
|
[SerializeField] Text m_FunctionName;//功能名
|
[SerializeField] Text m_FunctionalLevel;//功能解锁条件
|
[SerializeField] Text m_Content;//内容
|
[SerializeField] ItemCell m_Award;
|
[SerializeField] GameObject m_HasReceived1;
|
[SerializeField] RedpointBehaviour m_RedPoint;
|
FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
|
TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
|
|
public void GetTheFeatureID(int funcId)
|
{
|
var functionForecastConfig = FunctionForecastConfig.Get(funcId);
|
if (functionForecastConfig == null)
|
{
|
return;
|
}
|
var funcOpenConfig = FuncOpenLVConfig.Get(funcId);
|
|
m_FunctionName.text = funcOpenConfig.Remark;
|
|
if (FuncOpen.Instance.IsFuncOpen(funcId))
|
{
|
m_FunctionalLevel.text = "";
|
}
|
else if (funcOpenConfig.LimitMissionID != 0)
|
{
|
int tagValue = TaskListConfig.GetMissionIndex(funcOpenConfig.LimitMissionID);
|
int curValue = TaskListConfig.GetMissionIndex(taskModel.GetLatestMainTaskId());
|
if (funcId == 3)
|
{
|
//翅膀支线开启 FuncNoOpen2 funcid=3 支线等级客户端没有记录,后续优化是否配置在功能配置表
|
m_FunctionalLevel.text = Language.Get("FuncNoOpen2", 200);
|
}
|
else
|
{
|
m_FunctionalLevel.text = Language.Get("FuncNoOpen1", tagValue - curValue);
|
}
|
}
|
else
|
{
|
//后续完善境界解锁等
|
m_FunctionalLevel.text = Language.Get("FuncLevelOpen", funcOpenConfig.LimitLV);
|
}
|
|
|
m_FeaturesTypeIcon.SetSprite(funcOpenConfig.Icon);
|
m_Content.text = functionForecastConfig.DetailDescribe;
|
SetRankAwardItem(funcId);
|
|
if (FuncOpen.Instance.IsFuncOpen(funcId))
|
{
|
m_Image_Selected.gray = false;
|
m_FeaturesTypeIcon.gray = false;
|
}
|
else
|
{
|
m_Image_Selected.gray = true;
|
m_FeaturesTypeIcon.gray = true;
|
}
|
|
if (featureNoticeModel.DicRedPoint.ContainsKey(funcId))
|
{
|
m_RedPoint.redpointId = featureNoticeModel.DicRedPoint[funcId].id;
|
}
|
}
|
|
private void SetRankAwardItem(int funcID)
|
{
|
ImpactRankModel.RankAwardItem rankAward = featureNoticeModel.DicAwardItem[funcID];
|
List<Item> List = rankAward.GetAwardItem(PlayerDatas.Instance.baseData.Job);
|
SetItem1(List, funcID);
|
}
|
private void SetItem1(List<Item> List,int funcID)
|
{
|
int itemID = List[0].id;
|
int count = List[0].count;
|
m_Award.Init(new ItemCellModel(itemID, false, (ulong)count));
|
m_Award.button.AddListener(() => {
|
featureNoticeModel.SendGetAward(funcID);
|
});
|
|
|
if (featureNoticeModel.DicOpenFuncState.ContainsKey(funcID) && featureNoticeModel.DicOpenFuncState[funcID].State == 1 && featureNoticeModel.DicOpenFuncState[funcID].AwardState == 1)
|
{
|
m_HasReceived1.SetActive(true);
|
}
|
else
|
{
|
m_HasReceived1.SetActive(false);
|
}
|
}
|
}
|
|
}
|