TipMgr.cs 568 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using XRTool.Util;
  6. public class TipMgr : UnitySingleton<TipMgr>
  7. {
  8. protected override void Awake()
  9. {
  10. base.Awake();
  11. this.gameObject.SetActive(false);
  12. }
  13. public Text msgText;
  14. // Start is called before the first frame update
  15. public void ShowTip(string msg)
  16. {
  17. this.gameObject.SetActive(true);
  18. msgText.text = msg;
  19. TimerMgr.Instance.CreateTimer(() => { this.gameObject.SetActive(false); }, 2f);
  20. }
  21. }