127 lines
2.9 KiB
C#
127 lines
2.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
|
|
// 日常副本活动
|
|
// 等级不足按钮提示ID
|
|
public class DailyCopyMenuItem : UIItemSelect {
|
|
|
|
public class DailyCopyMenuItemData
|
|
{
|
|
public bool isLock = true;
|
|
public Tab_DailyCopy tab;
|
|
}
|
|
|
|
public Image normalBG;
|
|
public Text copySceneName;
|
|
public Text copySceneName_Select;
|
|
public Button lockButton;
|
|
public Text lockTip;
|
|
public GameObject remainTimeObj;
|
|
public Text remainTime;
|
|
|
|
private bool isLock = true;
|
|
public bool IsLock
|
|
{
|
|
private set
|
|
{
|
|
isLock = value;
|
|
}
|
|
get
|
|
{
|
|
return isLock;
|
|
}
|
|
}
|
|
|
|
|
|
private int copyID = -1;
|
|
public int CopyID
|
|
{
|
|
private set
|
|
{
|
|
copyID = value;
|
|
}
|
|
get
|
|
{
|
|
return copyID;
|
|
}
|
|
}
|
|
|
|
|
|
public override void Init()
|
|
{
|
|
base.Init();
|
|
lockButton.onClick.RemoveAllListeners();
|
|
lockButton.onClick.AddListener(OnLockClick);
|
|
}
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
DailyCopyMenuItemData info = hash["InitObj"] as DailyCopyMenuItemData;
|
|
if (info != null)
|
|
{
|
|
CopyID = info.tab.Id;
|
|
this._InitInfo = info;
|
|
Display(info);
|
|
}
|
|
else
|
|
{
|
|
this._InitInfo = null;
|
|
}
|
|
}
|
|
|
|
private void Display(DailyCopyMenuItemData info)
|
|
{
|
|
IsLock = info.isLock;
|
|
if (info.isLock == true)
|
|
{
|
|
lockButton.gameObject.SetActive(true);
|
|
SetText(copySceneName, info.tab.SceneName);
|
|
SetText(copySceneName_Select, info.tab.SceneName);
|
|
SetText(lockTip, StrDictionary.GetClientDictionaryString("#{51919}", info.tab.OpenLv.ToString()));
|
|
}
|
|
else
|
|
{
|
|
lockButton.gameObject.SetActive(false);
|
|
SetText(copySceneName, info.tab.SceneName);
|
|
SetText(copySceneName_Select, info.tab.SceneName);
|
|
}
|
|
}
|
|
|
|
private void SetText(Text text, string info)
|
|
{
|
|
string resultString = info.Replace("#r", "\n");
|
|
if (text.text != resultString)
|
|
{
|
|
text.text = resultString;
|
|
}
|
|
|
|
text.gameObject.SetActive(true);
|
|
}
|
|
|
|
public void SetRemainTime(int remainTime)
|
|
{
|
|
if (remainTime > 0 && IsLock == false)
|
|
{
|
|
remainTimeObj.SetActive(true);
|
|
SetText(this.remainTime, remainTime.ToString());
|
|
}
|
|
else
|
|
{
|
|
remainTimeObj.SetActive(false);
|
|
}
|
|
}
|
|
|
|
private void OnLockClick()
|
|
{
|
|
DailyCopyMenuItemData temp = this._InitInfo as DailyCopyMenuItemData;
|
|
if (temp != null)
|
|
{
|
|
string tip = StrDictionary.GetClientDictionaryString("#{51914}", temp.tab.SceneName, temp.tab.OpenLv);
|
|
GUIData.AddNotifyData(tip);
|
|
}
|
|
}
|
|
}
|