using System;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
//公会讨伐-其他玩家
|
public class GuildBossOtherPlayer : MonoBehaviour
|
{
|
[SerializeField] AvatarCell headCell;
|
[SerializeField] Text nameText;
|
[SerializeField] Text hurtValueText;
|
[SerializeField] Image rankImg;
|
|
[NonSerialized] public int moveState; // 0 缓慢移动,1 快速突进boss
|
[NonSerialized] public int playerID;
|
[NonSerialized] public Vector3 startPos;
|
public void Display(HA513_tagMCFamilyActionInfo.tagMCFamilyAction data)
|
{
|
playerID = (int)data.Value1;
|
var playData = GuildBossManager.Instance.GetMemberData(playerID);
|
headCell.InitUI(AvatarHelper.GetAvatarModel(playerID, playData.Face, playData.FacePic));
|
nameText.text = playData.Name;
|
hurtValueText.text = UIHelper.ReplaceLargeNum(data.Value4 + data.Value5 * Constants.ExpPointValue);
|
var rank = GetRankIndex(playerID);
|
if (rank == 0)
|
{
|
rankImg.SetActive(false);
|
}
|
else
|
{
|
rankImg.SetActive(true);
|
rankImg.SetSprite("GuildBossRank" + rank);
|
}
|
}
|
|
int GetRankIndex(int playerID)
|
{
|
int rank = 0;
|
for (int i = 0; i < 3; i++)
|
{
|
if (GuildBossManager.Instance.playerBossHurtRank[i].Value1 == playerID)
|
{
|
rank = i + 1;
|
break;
|
}
|
}
|
return rank;
|
}
|
|
public void NotePos()
|
{
|
startPos = transform.localPosition;
|
}
|
}
|