65 lines
2.0 KiB
C#
65 lines
2.0 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Games.Item;
|
|
using GCGame.Table;
|
|
using GCGame;
|
|
|
|
public class MeridiaItem : UIItemSelect
|
|
{
|
|
public class MeridiaItemData
|
|
{
|
|
public int VeinID;
|
|
public string name;
|
|
public string icon;
|
|
public string attrName;
|
|
public int openLevel;
|
|
}
|
|
|
|
public GameObject UnOPenObj;
|
|
public Text OpenLevel;
|
|
public Image Icon;
|
|
public Text AttrAdd;
|
|
public GameObject up;
|
|
MeridiaItem.MeridiaItemData m_data = null;
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
m_data = hash["InitObj"] as MeridiaItem.MeridiaItemData;
|
|
if (m_data == null)
|
|
return;
|
|
|
|
if(GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level < m_data.openLevel)
|
|
{
|
|
up.SetActive(false);
|
|
UnOPenObj.SetActive(true);
|
|
OpenLevel.text = StrDictionary.GetClientDictionaryString("#{5430}", m_data.openLevel);
|
|
}
|
|
else
|
|
{
|
|
UnOPenObj.SetActive(false);
|
|
up.SetActive(MeridiaSoulData.Instance.NodeCanUp(m_data.VeinID, -1));
|
|
}
|
|
AttrAdd.text = string.Format("{0}(<color=#019311ff>{1}</color>)", m_data.attrName, MeridiaSoulData.Instance.CountNodeLevel(m_data.VeinID));
|
|
LoadAssetBundle.Instance.SetImageSprite(Icon, m_data.icon);
|
|
|
|
base.Show();
|
|
}
|
|
|
|
public override void Refresh()
|
|
{
|
|
base.Refresh();
|
|
if (GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level < m_data.openLevel)
|
|
{
|
|
return;
|
|
}
|
|
|
|
up.SetActive(MeridiaSoulData.Instance.NodeCanUp(m_data.VeinID, -1));
|
|
AttrAdd.text = string.Format("{0}(<color=#019311ff>{1}</color>)", m_data.attrName, MeridiaSoulData.Instance.CountNodeLevel(m_data.VeinID));
|
|
}
|
|
|
|
public void UnOPen_Click()
|
|
{
|
|
GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{44036}",m_data.openLevel));
|
|
}
|
|
} |