using UnityEngine;
|
|
namespace vnxbqy.UI
|
{
|
public class FairySiegeScheduleFairyInfoCell : CellView
|
{
|
[SerializeField] AvatarCell avatar;
|
[SerializeField] ImageEx imgOfficialRank;
|
[SerializeField] TextEx txtPlayerFightPonit;
|
[SerializeField] TextEx txtPlayerName;
|
FairySiegeActModel model { get { return ModelCenter.Instance.GetModel<FairySiegeActModel>(); } }
|
RoleParticularModel roleParticularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
|
|
public void Display(int playerId)
|
{
|
if (model.tagFamilyInfoDict == null || !model.tagFamilyInfoDict.TryGetValue(model.queryFairyId, out var info) ||
|
info == null || info.tagFamilyMemberDict == null || !info.tagFamilyMemberDict.TryGetValue((uint)playerId, out var playerInfo))
|
return;
|
avatar.InitUI(AvatarHelper.GetAvatarModel((int)playerInfo.PlayerID, (int)playerInfo.Face, (int)playerInfo.FacePic, (int)playerInfo.Job));
|
avatar.button.SetListener(() =>
|
{
|
roleParticularModel.ViewCrossServerPlayerEquip((int)playerId);
|
});
|
|
if (!RealmConfig.Has(playerInfo.OfficialRank))
|
{
|
imgOfficialRank.SetActive(false);
|
}
|
else
|
{
|
imgOfficialRank.SetActive(true);
|
RealmConfig realmConfig = RealmConfig.Get(playerInfo.OfficialRank);
|
imgOfficialRank.SetSprite(realmConfig.Img);
|
}
|
txtPlayerFightPonit.text = UIHelper.ReplaceLargeNum(playerInfo.FightPower);
|
txtPlayerName.text = playerInfo.Name;
|
}
|
}
|
}
|