//--------------------------------------------------------
|
// [Author]: 玩个游戏
|
// [ Date ]: Tuesday, July 24, 2018
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
public class MainLevelDropCell : CellView
|
{
|
|
[SerializeField] Text dropValueText;
|
[SerializeField] ItemCell dropItemCell;
|
[SerializeField] Image lockImg;
|
|
|
public void Display(int itemID)
|
{
|
var value = PlayerDatas.Instance.baseData.ExAttr2;
|
var chapterID = value / 10000;
|
var config = MainChapterConfig.Get(chapterID);
|
var needChapterID = (int)MainChapterConfig.unLockedChapterDict[(object)itemID];
|
bool isLock = (int)needChapterID > chapterID;
|
|
dropItemCell.Init(new ItemCellModel(itemID, false, 0));
|
dropItemCell.button.AddListener(()=>
|
{
|
ItemTipUtility.Show(itemID);
|
});
|
|
if (isLock)
|
{
|
lockImg.SetActive(true);
|
dropValueText.text = UIHelper.AppendColor(TextColType.Red, needChapterID + "-" + "1" + Language.Get("FuncLimitOpen1"));
|
}
|
else
|
{
|
lockImg.SetActive(false);
|
int maxValue = 0;
|
if (config.DailyBootyUpperList != null)
|
{
|
for (int i = 0; i < config.DailyBootyUpperList.Length; i++)
|
{
|
if (config.DailyBootyUpperList[i][0] == itemID)
|
{
|
maxValue = config.DailyBootyUpperList[i][1];
|
break;
|
}
|
}
|
}
|
int curValue = 0;
|
MainLevelManager.Instance.m_DailyBootyDict.TryGetValue(itemID, out curValue);
|
dropValueText.text = UIHelper.AppendColor(curValue >= maxValue ? TextColType.Red : TextColType.Green,
|
UIHelper.ReplaceLargeNum(curValue) + "/" + UIHelper.ReplaceLargeNum(maxValue));
|
|
}
|
}
|
|
}
|