mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 00:57:14 +08:00
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/60
24 lines
461 B
C#
24 lines
461 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 => text.text;
|
|
set => text.text = value;
|
|
}
|
|
|
|
public void AddListener(UnityAction callback)
|
|
{
|
|
button.onClick.AddListener(callback);
|
|
}
|
|
}
|
|
} |