Unity_Web/Assets/1_Script/InfoPageCtrl.cs

24 lines
438 B
C#

using System;
using TMPro;
using UnityEngine;
public class InfoPageCtrl : MonoBehaviour
{
[SerializeField] TMP_Text message;
private Action action;
public void Set(string message, Action action = null)
{
this.message.text = message;
this.action = action;
gameObject.SetActive(true);
}
public void okButton()
{
action?.Invoke();
gameObject.SetActive(false);
}
}