38 lines
1014 B
C#
38 lines
1014 B
C#
using System;
|
|
using TMPro;
|
|
using UnityEngine.UI;
|
|
|
|
namespace ZC
|
|
{
|
|
[UIType(UIType.MinTipsUI)]
|
|
public class MinTipsUI : UIBase
|
|
{
|
|
private TMP_Text txt_Title;
|
|
private TMP_Text txt_Content;
|
|
private Button btn_Close;
|
|
private Action closeAction;
|
|
|
|
public override void Init()
|
|
{
|
|
base.Init();
|
|
this.txt_Title = GetValue<TMP_Text>("txt_Title");
|
|
this.txt_Content = GetValue<TMP_Text>("txt_Content");
|
|
this.btn_Close = GetValue<Button>("btn_Close");
|
|
|
|
btn_Close.onClick.AddListener(ClickClose);
|
|
}
|
|
|
|
private void ClickClose()
|
|
{
|
|
EventManager.Instance.FireNow(this, new UIHideOrShowEventArgs(UIType.MinTipsUI));
|
|
closeAction?.Invoke();
|
|
}
|
|
|
|
public void SetData(string title, string content, Action callback = null)
|
|
{
|
|
txt_Title.text = title;
|
|
txt_Content.text = content;
|
|
closeAction = callback;
|
|
}
|
|
}
|
|
} |