44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PvpSelfTeamRoleInfoItem : UIItemBase {
|
|
|
|
public long _Guid;
|
|
public Text _Name;
|
|
public Image _HeadIcon;
|
|
public Text _HpVal;
|
|
public Slider _HpSlider;
|
|
public Text _Level;
|
|
|
|
public Material _GrayMaterial;
|
|
//public GameObject _DeadIcon;
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
base.Show(hash);
|
|
HonorBattlefieldMatchMemberInfo info = (HonorBattlefieldMatchMemberInfo)hash["InitObj"];
|
|
_Guid = info.Guid;
|
|
_Name.text = info.Name;
|
|
LoadAssetBundle.Instance.SetImageSprite(_HeadIcon, GCGame.Utils.GetProfessionSpriteName(info.Job));
|
|
_HpVal.text = info.Hp + "/" + info.MaxHp;
|
|
_HpSlider.value = (float)info.Hp / (float)info.MaxHp;
|
|
_Level.text = info.Level + "";
|
|
|
|
_HeadIcon.material = _HeadIcon.defaultMaterial;
|
|
}
|
|
|
|
public void RefreshItemInfo(HonorBattlefieldMatchMemberInfo info)
|
|
{
|
|
_HpVal.text = info.Hp + "/" + info.MaxHp;
|
|
_HpSlider.value = (float)info.Hp / (float)info.MaxHp;
|
|
if(info.Hp <= 0)
|
|
{
|
|
_HeadIcon.material = _GrayMaterial;
|
|
}
|
|
}
|
|
|
|
|
|
}
|