Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
26 lines
464 B
C#
26 lines
464 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Prefab
|
|
{
|
|
public class ButtonPrefab:MonoBehaviour
|
|
{
|
|
public Button button;
|
|
public TMP_Text text;
|
|
|
|
public string Label
|
|
{
|
|
get{return text.text;}
|
|
set{text.text = value;}
|
|
}
|
|
|
|
public void AddListener(UnityAction callback)
|
|
{
|
|
button.onClick.AddListener(callback);
|
|
}
|
|
}
|
|
|
|
|
|
} |