using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
/// <summary>
|
/// 公会大厅 成员
|
/// </summary>
|
public class GuildMemberCell : CellView
|
{
|
|
[SerializeField] AvatarCell avatarCell;
|
[SerializeField] OfficialTitleCell titleCell;
|
[SerializeField] Text lvText;
|
[SerializeField] Text guildJobText;
|
[SerializeField] Image guildJobImg;
|
[SerializeField] Text nameText;
|
[SerializeField] Text fightPowerText;
|
[SerializeField] Text contribText;
|
[SerializeField] Text loginTimeText;
|
|
[SerializeField] Button showOpBtn;
|
[SerializeField] Image showArrowImg;
|
|
|
|
public void Display(int index)
|
{
|
var playerID = PlayerDatas.Instance.fairyData.memberIDList[index];
|
var playerInfo = PlayerDatas.Instance.fairyData.GetMember(playerID);
|
nameText.text = playerInfo.Name;
|
|
avatarCell.InitUI(AvatarHelper.GetAvatarModel(0, playerInfo.Face, playerInfo.FacePic));
|
titleCell.InitUI(playerInfo.RealmLV, playerInfo.TitleID);
|
lvText.text = playerInfo.LV.ToString();
|
if (playerInfo.FmLV > 0)
|
{
|
guildJobImg.SetActive(true);
|
guildJobText.text = RichTextMsgReplaceConfig.GetRichReplace("FAMILY", playerInfo.FmLV);
|
guildJobImg.SetSprite("GuildJob" + playerInfo.FmLV);
|
}
|
else
|
{
|
guildJobImg.SetActive(false);
|
}
|
|
fightPowerText.text = UIHelper.ReplaceLargeArtNum(playerInfo.FightPower);
|
|
avatarCell.button.AddListener(() =>
|
{
|
OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerID);
|
});
|
|
contribText.text = playerInfo.ContribDay + "/" + playerInfo.ContribTotal;
|
int leftTime = TimeUtility.AllSeconds - playerInfo.OffTime;
|
if (playerInfo.OffTime == 0)
|
{
|
loginTimeText.text = UIHelper.AppendColor(TextColType.Green, Language.Get("L1025"));
|
}
|
else if (leftTime < 60)
|
{
|
loginTimeText.text = Language.Get("Guild_63"); //刚刚在线
|
}
|
else
|
{
|
loginTimeText.text = Language.Get("Guild_61", TimeUtility.SecondsToConsumeRebate(leftTime));
|
}
|
|
|
showOpBtn.SetActive(PlayerDatas.Instance.fairyData.mine.FmLV >= GuildManager.Instance.GetNeedGuildJobLV((int)GuildFuncType.ChangeJob)
|
&& PlayerDatas.Instance.fairyData.mine.FmLV > playerInfo.FmLV);
|
|
showOpBtn.AddListener(() =>
|
{
|
if (GuildManager.Instance.memberOPIndex == index)
|
{
|
GuildManager.Instance.memberOPIndex = -1;
|
return;
|
}
|
GuildManager.Instance.memberOPIndex = index;
|
});
|
|
if (GuildManager.Instance.memberOPIndex == index)
|
{
|
//展开
|
showArrowImg.transform.localScale = new Vector3(1, 1, 1);
|
}
|
else
|
{
|
showArrowImg.transform.localScale = new Vector3(1, -1, 1);
|
}
|
}
|
|
}
|