37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine.UI;
|
|
|
|
public class ClubItem : PanelItemBase<ClubItemData>
|
|
{
|
|
//public GameObject bg_myself;
|
|
public TMP_Text text_name;
|
|
public TMP_Text text_stage;
|
|
public ClubHead head;
|
|
public TMP_Text text_people_num;
|
|
public TMP_Text text_club_trophy;
|
|
public Button btn_click;
|
|
private void Awake()
|
|
{
|
|
//bg_myself = transform.Find("bg_myself").gameObject;
|
|
text_name = transform.Find("text_name").GetComponent<TMP_Text>();
|
|
text_stage = transform.Find("text_stage").GetComponent<TMP_Text>();
|
|
head = transform.Find("btn_head").GetComponent<ClubHead>();
|
|
text_people_num = transform.Find("info/text_people_num").GetComponent<TMP_Text>();
|
|
text_club_trophy = transform.Find("info/text_club_trophy").GetComponent<TMP_Text>();
|
|
btn_click = transform.GetComponent<Button>();
|
|
}
|
|
private void Start()
|
|
{
|
|
btn_click.onClick.AddListener(OnBtnItem);
|
|
}
|
|
public override void OnInit()
|
|
{
|
|
text_name.text = data.name;
|
|
text_stage.text = LocalizationMgr.GetText(data.type.ToString());
|
|
head.SetData(data.icon);
|
|
text_people_num.text = $"{data.memberCount}/{data.memberLimit}";
|
|
text_club_trophy.text = data.trophy.ToString();
|
|
}
|
|
}
|