156 lines
4.7 KiB
C#
156 lines
4.7 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.GlobeDefine;
|
|
using GCGame.Table;
|
|
|
|
public class TeamInfoMemberItem : UIItemBase
|
|
{
|
|
#region
|
|
|
|
public GameObject _CapterIcon;
|
|
public Image _MemberProIcon;
|
|
public UICameraTexture _MemberModelView;
|
|
public Text _MemberLevel;
|
|
public Text _MemberName;
|
|
public Text _MemberInfo1;
|
|
public Text _MemberInfo2;
|
|
public GameObject _NoneMemberImg;
|
|
public GameObject _OfflineGO;
|
|
|
|
private TeamMember _TeamInfo;
|
|
//private GameObject _MemberModel;
|
|
|
|
private int _PreProfession;
|
|
private int _PreWeaponData;
|
|
private int _PreWingAurId;
|
|
private int _PreWeaponGemEffect3;
|
|
private int _PreEffectAuraId;
|
|
private int _PreModelVisual;
|
|
|
|
public void OnEnable()
|
|
{
|
|
if (_TeamInfo != null && _TeamInfo.Guid != GlobeVar.INVALID_GUID)
|
|
{
|
|
ShowModel();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
base.Show();
|
|
}
|
|
|
|
public void InitTeamInfo(TeamMember teamInfo)
|
|
{
|
|
|
|
if (teamInfo == null || teamInfo.Guid == GlobeVar.INVALID_GUID)
|
|
{
|
|
_NoneMemberImg.SetActive(true);
|
|
_MemberModelView.gameObject.SetActive(false);
|
|
_CapterIcon.gameObject.SetActive(false);
|
|
_MemberProIcon.gameObject.SetActive(false);
|
|
_MemberProIcon.transform.parent.gameObject.SetActive(false);
|
|
_MemberLevel.gameObject.SetActive(false);
|
|
_MemberName.gameObject.SetActive(false);
|
|
_MemberInfo1.gameObject.SetActive(false);
|
|
_MemberInfo2.gameObject.SetActive(false);
|
|
_TeamInfo = null;
|
|
_OfflineGO.SetActive(false);
|
|
_MemberModelView.DestroyObj();
|
|
return;
|
|
}
|
|
_NoneMemberImg.SetActive(false);
|
|
_MemberModelView.gameObject.SetActive(true);
|
|
_CapterIcon.gameObject.SetActive(true);
|
|
_MemberProIcon.gameObject.SetActive(true);
|
|
_MemberProIcon.transform.parent.gameObject.SetActive(true);
|
|
_MemberLevel.gameObject.SetActive(true);
|
|
_MemberName.gameObject.SetActive(true);
|
|
_MemberModelView.isPreview = true;
|
|
if (_TeamInfo == null || teamInfo.Profession != _TeamInfo.Profession)
|
|
{
|
|
LoadAssetBundle.Instance.SetImageSprite(_MemberProIcon, GetProIcon(teamInfo.Profession));
|
|
}
|
|
if (teamInfo.TeamJob == 0)
|
|
{
|
|
_CapterIcon.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
_CapterIcon.SetActive(false);
|
|
}
|
|
_MemberLevel.text = StrDictionary.GetClientDictionaryString("#{1738}", teamInfo.Level);
|
|
_MemberName.text = teamInfo.MemberName;
|
|
_MemberInfo1.text = StrDictionary.GetClientDictionaryString("#{1064}", teamInfo.CombatNum);
|
|
_MemberInfo2.text = "";
|
|
|
|
if (_TeamInfo == null
|
|
|| _PreProfession != teamInfo.Profession
|
|
|| _PreWeaponData != teamInfo.WeaponData
|
|
|| _PreWingAurId != teamInfo.WingAurId
|
|
|| _PreWeaponGemEffect3 != teamInfo.WeaponGemEffect3
|
|
|| _PreEffectAuraId != teamInfo.EffectAuraId
|
|
|| _PreModelVisual != teamInfo.ModelVisual
|
|
)
|
|
{
|
|
_PreProfession = teamInfo.Profession;
|
|
_PreWeaponData = teamInfo.WeaponData;
|
|
_PreWingAurId = teamInfo.WingAurId;
|
|
_PreWeaponGemEffect3 = teamInfo.WeaponGemEffect3;
|
|
_PreEffectAuraId = teamInfo.EffectAuraId;
|
|
_PreModelVisual = teamInfo.ModelVisual;
|
|
|
|
_TeamInfo = teamInfo;
|
|
ShowModel();
|
|
}
|
|
_TeamInfo = teamInfo;
|
|
|
|
_OfflineGO.SetActive(!teamInfo.IsOnline);
|
|
}
|
|
|
|
public string GetProIcon(int pro)
|
|
{
|
|
switch ((CharacterDefine.PROFESSION)pro)
|
|
{
|
|
case CharacterDefine.PROFESSION.TIANJI:
|
|
return "ProTianji";
|
|
case CharacterDefine.PROFESSION.LIUSHAN:
|
|
return "ProLiushan";
|
|
case CharacterDefine.PROFESSION.SHUSHAN:
|
|
return "ProShushan";
|
|
case CharacterDefine.PROFESSION.XUANNV:
|
|
return "ProXuannv";
|
|
}
|
|
|
|
return "";
|
|
}
|
|
|
|
|
|
private void ShowModel()
|
|
{
|
|
_MemberModelView.InitModel(_TeamInfo.Profession,GlobalData.GetCharModelId(_TeamInfo.Profession, _TeamInfo.ModelVisual), _TeamInfo.WeaponData, _TeamInfo.WingAurId, _TeamInfo.WeaponGemEffect3, _TeamInfo.EffectAuraId);
|
|
}
|
|
|
|
#region act
|
|
|
|
public override void OnItemClick()
|
|
{
|
|
if (_TeamInfo != null && _TeamInfo.Guid != GlobeVar.INVALID_GUID)
|
|
{
|
|
PopMenuLogic.ShowMenu("TeamMemberPopMenu", gameObject, _TeamInfo.Guid, _TeamInfo.MemberName);
|
|
}
|
|
//else
|
|
//{
|
|
// UIManager.ShowUI(UIInfo.TeamInvateRoot);
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
}
|