2025-07-19 19:03:53 +08:00
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Events;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
namespace Prefab
|
|
|
|
{
|
2025-08-28 16:20:24 +08:00
|
|
|
public class ButtonPrefab : MonoBehaviour
|
2025-07-19 19:03:53 +08:00
|
|
|
{
|
|
|
|
public Button button;
|
|
|
|
public TMP_Text text;
|
|
|
|
|
|
|
|
public string Label
|
|
|
|
{
|
2025-08-28 16:20:24 +08:00
|
|
|
get { return text.text; }
|
|
|
|
set { text.text = value; }
|
2025-07-19 19:03:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public void AddListener(UnityAction callback)
|
|
|
|
{
|
|
|
|
button.onClick.AddListener(callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|