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 PetBookAddAttr : UIItemBase { #region public class AttrInfo { public int ProID = -1; public int PropValue = 0; public int PropCurrAdd = 0; } #endregion public Text _PropName; public Text _PropValue; public Text _PropCurr; private AttrInfo _ChangeAttr; public override void Show(Hashtable hash) { base.Show(); _ChangeAttr = (AttrInfo)hash["InitObj"]; ShowAttr(); } public override void Refresh(Hashtable hash) { base.Refresh(hash); _PropCurr.gameObject.SetActive(false); _PropCurr.text = ""; } public override void Refresh() { base.Refresh(); ShowAttr(); } public void ShowAttr() { _PropName.text = PropID.GetAttrName((PropID.PropertyID)_ChangeAttr.ProID); _PropValue.text = _ChangeAttr.PropValue.ToString(); if(_ChangeAttr.PropCurrAdd > 0) { _PropCurr.gameObject.SetActive(true); _PropCurr.text = "+" + _ChangeAttr.PropCurrAdd.ToString(); } } }