Files
JJBB/Assets/Project/Script/GUI/FactionChallenge/FactionAdvanceMatchItem.cs
2024-08-23 15:49:34 +08:00

34 lines
871 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FactionAdvanceMatchItem : MonoBehaviour {
public Image _RoleHeadIcon;
public GameObject _InvateBtn;
public Text _Name;
public void InitItem(int profession = -1, string name = "")
{
if(profession == -1)
{
_RoleHeadIcon.gameObject.SetActive(false);
_InvateBtn.SetActive(true);
_Name.text = "";
}
else
{
_InvateBtn.SetActive(false);
_RoleHeadIcon.gameObject.SetActive(true);
LoadAssetBundle.Instance.SetImageSprite(_RoleHeadIcon, GCGame.Utils.GetProfessionSpriteName(profession));
_Name.text = name;
}
}
public void OnInvateBtn()
{
UIManager.ShowUI(UIInfo.TeamInvateRoot);
}
}