using UnityEngine; using UnityEngine.UI; using System.Collections; using System; using GCGame; using GCGame.Table; public class BossBookAttrItem : UIItemBase { public Text _AttrText; public override void Show(Hashtable hash) { base.Show(hash); var attrPair = (RoleViewAttrPair.AttrPair)hash["InitObj"]; _InitInfo = attrPair; SetAttr(attrPair); } public void SetAttr(RoleViewAttrPair.AttrPair attrPair) { var attrName = PropID.GetAttrName(attrPair._PropID, attrPair._SubID, attrPair._Value1); // 如果是对职业的加成伤害,用百分比显示 if(attrPair._PropID == PropID.PropertyID.VOCDAMAGERATE) { attrName += "+" + "" + attrPair.GetValue1PercentageStr() + ""; } else { attrName += "+" + "" + attrPair.GetValue1Str() + ""; } _AttrText.text = attrName; } }