JJBB/Assets/Project/Script/GUI/Equip/EquipChangeAttrItem.cs
2024-08-23 15:49:34 +08:00

62 lines
1.5 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using GCGame.Table;
using Games.Mission;
using Games.Events;
using Games.Item;
public class EquipChangeAttrItem : UIItemBase
{
#region
public class ChangeAttrInfo
{
public string PropName;
public int PropOrgValue;
public int PropNewValue;
}
#endregion
public Text _PropName;
public Text _PropValueOrg;
public Text _PropValueNew;
public GameObject _ArrowUp;
public GameObject _ArrowDown;
private ChangeAttrInfo _ChangeAttr;
public override void Show(Hashtable hash)
{
base.Show();
_ChangeAttr = (ChangeAttrInfo)hash["InitObj"];
ShowAttr();
}
public void ShowAttr()
{
_PropName.text = _ChangeAttr.PropName;
_PropValueOrg.text = _ChangeAttr.PropOrgValue.ToString();
if (_ChangeAttr.PropNewValue > _ChangeAttr.PropOrgValue)
{
_PropValueNew.text = StrDictionary.GetClientDictionaryString("#{5528}") + _ChangeAttr.PropNewValue.ToString() + "</color>";
_ArrowUp.gameObject.SetActive(true);
_ArrowDown.gameObject.SetActive(false);
}
else
{
_PropValueNew.text = StrDictionary.GetClientDictionaryString("#{5529}") + _ChangeAttr.PropNewValue.ToString() + "</color>";
_ArrowUp.gameObject.SetActive(false);
_ArrowDown.gameObject.SetActive(true);
}
}
}