Files
BH3/Assets/Scripts/Assembly-CSharp/MoleMole/MonoGMTalkButton.cs
2025-08-13 09:26:42 +08:00

30 lines
574 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace MoleMole
{
public class MonoGMTalkButton : MonoBehaviour
{
public delegate void ButtonCallBack(string command);
private string _command;
private ButtonCallBack _buttonCallback;
public void SetupView(string command, ButtonCallBack buttonCallback = null)
{
_command = command;
_buttonCallback = buttonCallback;
base.transform.Find("Text").GetComponent<Text>().text = command;
}
public void OnButtonCallBack()
{
if (_buttonCallback != null)
{
_buttonCallback(_command);
}
}
}
}