mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 08:25:20 +01:00
30 lines
574 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|