67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.GlobeDefine;
|
|
|
|
public class TeamInvateInfoItem : UIItemBase
|
|
{
|
|
#region
|
|
|
|
public Image _CapterIcon;
|
|
public Image _ProfIcon;
|
|
public Text _CapterName;
|
|
public Text _CapterLv;
|
|
public Button _BtnApply;
|
|
public Text _CombatValue;
|
|
|
|
private TeamInfo _TeamInfo;
|
|
#endregion
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
base.Show();
|
|
|
|
var teamInfo = (TeamInfo)hash["InitObj"];
|
|
InitTeamInfo(teamInfo);
|
|
}
|
|
|
|
private void InitTeamInfo(TeamInfo teamInfo)
|
|
{
|
|
if (teamInfo == null)
|
|
return;
|
|
|
|
_TeamInfo = teamInfo;
|
|
|
|
LoadAssetBundle.Instance.SetImageSprite(_CapterIcon, GCGame.Utils.GetProfessionSpriteName(_TeamInfo.Profession));
|
|
LoadAssetBundle.Instance.SetImageSprite(_ProfIcon, GCGame.Utils.GetProfessionIconName((CharacterDefine.PROFESSION)_TeamInfo.Profession));
|
|
_CapterName.text = _TeamInfo.Name;
|
|
_CapterLv.text = _TeamInfo.Level.ToString();
|
|
_CombatValue.text = _TeamInfo.CombatNum.ToString();
|
|
|
|
_BtnApply.interactable = true;
|
|
}
|
|
|
|
public void BtnInvate()
|
|
{
|
|
if (Singleton<ObjManager>.GetInstance() == null)
|
|
{
|
|
return;
|
|
}
|
|
if (_TeamInfo.Guid == GlobeVar.INVALID_GUID || _TeamInfo.Guid == GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid)
|
|
{
|
|
Singleton<ObjManager>.GetInstance().MainPlayer.SendNoticMsg(false, "#{1930}");
|
|
return;
|
|
}
|
|
|
|
//if (Singleton<ObjManager>.GetInstance().MainPlayer)
|
|
//{
|
|
// Singleton<ObjManager>.GetInstance().MainPlayer.SendNoticMsg(false, "#{3170}");
|
|
//}
|
|
CG_REQ_TEAM_INVITE packet = (CG_REQ_TEAM_INVITE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_REQ_TEAM_INVITE);
|
|
packet.SetGuid(_TeamInfo.Guid);
|
|
packet.SendPacket();
|
|
|
|
_BtnApply.interactable = false;
|
|
}
|
|
}
|