54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.Item;
|
|
using GCGame.Table;
|
|
using GCGame;
|
|
|
|
public class GuildXiulianItem : UIItemSelect
|
|
{
|
|
public Text AttrName;
|
|
public Text ExpLevel;
|
|
public Slider ExpSlider;
|
|
public Text State;
|
|
|
|
GuildXiulianWnd.AttrInfo m_GuildAttr;
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
|
|
m_GuildAttr = hash["InitObj"] as GuildXiulianWnd.AttrInfo;
|
|
Refresh();
|
|
base.Show();
|
|
}
|
|
|
|
public override void Refresh()
|
|
{
|
|
base.Refresh();
|
|
if (m_GuildAttr == null || m_GuildAttr.attrTab == null)
|
|
return;
|
|
AttrName.text = m_GuildAttr.attrTab.Describe;
|
|
if (m_GuildAttr.attrLevel == -1)
|
|
{
|
|
State.text = GCGame.Table.StrDictionary.GetClientDictionaryString("#{24982}", m_GuildAttr.attrTab.GuildCollegeLevel);
|
|
ExpLevel.text = "";
|
|
ExpSlider.gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
ExpSlider.gameObject.SetActive(true);
|
|
State.text = "LV." + m_GuildAttr.attrLevel;
|
|
if (m_GuildAttr.attrLevel >= m_GuildAttr.attrTab.getLevelCount())
|
|
{
|
|
ExpLevel.text = GCGame.Table.StrDictionary.GetClientDictionaryString("#{25096}");
|
|
ExpSlider.value = 1;
|
|
}
|
|
else
|
|
{
|
|
ExpLevel.text = string.Format("{0}/{1}", m_GuildAttr.attrExp, m_GuildAttr.attrTab.GetExpbyIndex(m_GuildAttr.attrLevel));
|
|
ExpSlider.value = (m_GuildAttr.attrExp * 1.0f) / m_GuildAttr.attrTab.GetExpbyIndex(m_GuildAttr.attrLevel);
|
|
}
|
|
}
|
|
}
|
|
}
|