ErrorManager.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TMPro;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. using XRTool.Util;
  7. public class ErrorManager : WindowSingleton<ErrorManager>
  8. {
  9. public RawImage iconBg;
  10. public RawImage icon;
  11. public TextMeshProUGUI TitleText;
  12. public TextMeshProUGUI MessageText;
  13. public TextMeshProUGUI actionText;
  14. public GameObject actionTextGO;
  15. public GameObject actionButtonGO;
  16. int timeDjs = 0;
  17. public void show(string title,string Msg,Texture iconBg,Texture icon,bool isText=true,string djsMsg="",int time=5)
  18. {
  19. this.gameObject.SetActive(true);
  20. if(isText)
  21. {
  22. actionTextGO.gameObject.SetActive(true);
  23. actionButtonGO.gameObject.SetActive(false);
  24. timeDjs = time;
  25. TimerMgr.Instance.CreateTimer(()=> {
  26. timeDjs--;
  27. // actionText = "";
  28. },1, time);
  29. }
  30. }
  31. public void hide()
  32. {
  33. this.gameObject.SetActive(false);
  34. }
  35. }