62 lines
1.6 KiB
C#
62 lines
1.6 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.Item;
|
|
using GCGame.Table;
|
|
using Games.ChatHistory;
|
|
using GCGame;
|
|
using Games.GlobeDefine;
|
|
|
|
public class FriendRelationItem : UIItemSelect
|
|
{
|
|
private static Material _ImageGrayMaterial;
|
|
public static Material ImageGrayMaterial
|
|
{
|
|
get
|
|
{
|
|
if (_ImageGrayMaterial == null)
|
|
_ImageGrayMaterial = CommonUtility.LoadSharedMaterial(GlobeVar.grayMaterialName);
|
|
return _ImageGrayMaterial;
|
|
}
|
|
}
|
|
|
|
public Text _Name;
|
|
public Image _Icon;
|
|
public Text _RelationTip;
|
|
|
|
Relation _Relation;
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
base.Show();
|
|
|
|
if (hash["InitObj"] is Relation)
|
|
{
|
|
_Relation = (Relation)hash["InitObj"];
|
|
}
|
|
|
|
InitRelation();
|
|
}
|
|
|
|
private void InitRelation()
|
|
{
|
|
_Name.text = _Relation.Name;
|
|
if (_Relation.Guid == GlobeVar.SYSFRIEND_GUID)
|
|
{
|
|
LoadAssetBundle.Instance.SetImageSprite(_Icon, Utils.GetSysIconName(Utils.SysIconType.Sys));
|
|
}
|
|
else if (_Relation.Guid == GlobeVar.HELPFRIEND_GUID)
|
|
{
|
|
LoadAssetBundle.Instance.SetImageSprite(_Icon, Utils.GetSysIconName(Utils.SysIconType.AI));
|
|
}
|
|
else
|
|
{
|
|
string spriteName = Utils.GetProfessionSpriteName(_Relation.Profession);
|
|
LoadAssetBundle.Instance.SetImageSprite(_Icon, spriteName);
|
|
}
|
|
|
|
_RelationTip.text = StrDictionary.GetClientDictionaryString("#{5221}", _Relation.FriendPoint.ToString());
|
|
}
|
|
|
|
}
|