using System; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class MessageBoxController : MonoBehaviour { // Start is called before the first frame update //void Start() //{ //} // Update is called once per frame //void Update() //{ //} /*功能:跳出提示框。点击OK后消失 msg: 提示内容 callbackAction 绑定OK按键对应的函数*/ public static void ShowMessage(string msg, Action callbackAction=null) { GameObject messageBox = Resources.Load("MessageBox/MessageBox"); Instantiate(messageBox); if (messageBox != null) { GameObject msgBodyObject = GameObject.Find("msgBody"); GameObject btnOkObject = GameObject.Find("btn_OK"); msgBodyObject.GetComponent().text = msg; Button btnOk = btnOkObject.GetComponent