备份CatanBuilding瘦身独立工程
This commit is contained in:
36
Assets/Scripts/UI/Social/ClubItem.cs
Normal file
36
Assets/Scripts/UI/Social/ClubItem.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user