using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; public class TipPanel : MonoBehaviour { public static TipPanel tipPrefb; public TextMeshProUGUI m_TextMeshProUGUI; public void Init(string tip) { m_TextMeshProUGUI.text= tip; Invoke("Des", 2); } public void Des() { Destroy(gameObject); } public static TipPanel ShowTip(string msg) { if(tipPrefb==null) tipPrefb= Resources.Load("UI/UI_Tip/TipPanel"); if (GameManager.UIMgr != null) { TipPanel tip2 = Instantiate(tipPrefb, GameManager.UIMgr.canvas.transform); tip2.Init(msg); return tip2; } return null; } }