67 lines
1.3 KiB
C#
67 lines
1.3 KiB
C#
using System;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
namespace ZC
|
|
{
|
|
[UIType(UIType.UrineSamplingUI)]
|
|
public class UrineSamplingUI : UIBase
|
|
{
|
|
Action callback;
|
|
|
|
#region AutoGen_InitIon
|
|
|
|
public TMP_Text txt_Title;
|
|
public Image img_Pic;
|
|
public TMP_Text txt_Content;
|
|
public Button btn_Close;
|
|
|
|
#endregion
|
|
|
|
public override void Init()
|
|
{
|
|
base.Init();
|
|
|
|
#region AutoGen_Init
|
|
|
|
txt_Title = GetValue<TMP_Text>("txt_Title");
|
|
img_Pic = GetValue<Image>("img_Pic");
|
|
txt_Content = GetValue<TMP_Text>("txt_Content");
|
|
btn_Close = GetValue<Button>("btn_Close");
|
|
|
|
btn_Close.onClick.AddListener(OnClickbtn_Close);
|
|
|
|
#endregion
|
|
}
|
|
|
|
public void SetData(Action callback)
|
|
{
|
|
this.callback = callback;
|
|
}
|
|
|
|
#region AutoGen_Method
|
|
|
|
private void OnClickbtn_Close()
|
|
{
|
|
callback?.Invoke();
|
|
}
|
|
|
|
#endregion
|
|
|
|
public override void Dispose()
|
|
{
|
|
base.Dispose();
|
|
|
|
#region AutoGen_Dispose
|
|
|
|
btn_Close.onClick.RemoveListener(OnClickbtn_Close);
|
|
|
|
txt_Title = null;
|
|
img_Pic = null;
|
|
txt_Content = null;
|
|
btn_Close = null;
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
} |