38 lines
978 B
C#
38 lines
978 B
C#
|
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 += "+" + "<color=#ffffff>" + attrPair.GetValue1PercentageStr() + "</color>";
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
attrName += "+" + "<color=#ffffff>" + attrPair.GetValue1Str() + "</color>";
|
|||
|
}
|
|||
|
|
|||
|
_AttrText.text = attrName;
|
|||
|
}
|
|||
|
}
|