80 lines
2.7 KiB
C#
80 lines
2.7 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using Games.Item;
|
|||
|
using GCGame;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class FrenzyInfoItem : MonoBehaviour {
|
|||
|
|
|||
|
public CommonItemEquipItem equipItem;
|
|||
|
public Text equipNameLabel;
|
|||
|
public Text combatValue;
|
|||
|
public GameObject _AttrPanel;
|
|||
|
public Text[] attr;
|
|||
|
|
|||
|
public void Show(GameItem equip, bool showAttr = true)
|
|||
|
{
|
|||
|
Hashtable info = new Hashtable();
|
|||
|
info.Add("InitObj", equip);
|
|||
|
equipItem.Show(info);
|
|||
|
|
|||
|
combatValue.text = equip.EnchanceScore.ToString();
|
|||
|
|
|||
|
if (showAttr)
|
|||
|
{
|
|||
|
_AttrPanel.SetActive(true);
|
|||
|
equipNameLabel.gameObject.SetActive(true);
|
|||
|
equipNameLabel.text = equip.GetEquipName();
|
|||
|
|
|||
|
Tab_EquipAttr tabItem = TableManager.GetEquipAttrByID(equip.DataID, 0);
|
|||
|
for (int i = 0; i < attr.Length; ++i)
|
|||
|
{
|
|||
|
if (equip.BaseAttrs.Count <= i)
|
|||
|
{
|
|||
|
attr[i].gameObject.SetActive(false);
|
|||
|
continue;
|
|||
|
}
|
|||
|
|
|||
|
int strength = equip.GetTotalStrengthVal();
|
|||
|
attr[i].gameObject.SetActive(true);
|
|||
|
attr[i].text = PropID.GetAttrValue(equip.BaseAttrs[i]._PropID, equip.BaseAttrs[i]._SubID, equip.BaseAttrs[i]._Value1).Replace('+', ' ');
|
|||
|
if (strength > 0 && tabItem.GetIsEnchanceAddbyIndex(i) > 0)
|
|||
|
{
|
|||
|
int enhanceUp = equip.GetStrengthVal();
|
|||
|
int frenzyUp = (int)(tabItem.GetPropValuebyIndex(i) * equip.GetFrenzyVal() / 100.0f);
|
|||
|
if (equip.IsFrenzy)
|
|||
|
{
|
|||
|
attr[i].text += StrDictionary.GetClientDictionaryString("#{5418}") + "+" + frenzyUp + StrDictionary.GetClientDictionaryString("#{5808}") + "</color>";
|
|||
|
}
|
|||
|
if (enhanceUp > 0)
|
|||
|
{
|
|||
|
attr[i].text += StrDictionary.GetClientDictionaryString("#{5809}") + "+" + enhanceUp + "%" + StrDictionary.GetClientDictionaryString("#{5807}") + "</color>";
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_AttrPanel.SetActive(false);
|
|||
|
equipNameLabel.gameObject.SetActive(false);
|
|||
|
for (int i = 0; i < attr.Length; ++i)
|
|||
|
{
|
|||
|
attr[i].gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void ShowNothing()
|
|||
|
{
|
|||
|
equipItem.gameObject.SetActive(false);
|
|||
|
equipNameLabel.text = "";
|
|||
|
combatValue.text = "";
|
|||
|
for(int i = 0; i < attr.Length; ++i)
|
|||
|
{
|
|||
|
attr[i].gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|