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); } }