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); } }