UILogManager.cs 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using Ximmerse.XR.Utils;
  6. using Ximmerse.XR.Internal;
  7. public class UILogManager : MonoBehaviour
  8. {
  9. public static UILogManager Instance;
  10. public Text text1;
  11. public Text text2;
  12. public Text text3;
  13. private void Awake()
  14. {
  15. if (Instance)
  16. {
  17. DestroyImmediate(gameObject);
  18. return;
  19. }
  20. Instance = this;
  21. }
  22. public void SendLogText(int Lv, string msg)
  23. {
  24. switch (Lv)
  25. {
  26. case 1:
  27. text1.text = msg;
  28. break;
  29. case 2:
  30. text2.text = msg;
  31. break;
  32. default:
  33. text3.text = msg;
  34. break;
  35. }
  36. }
  37. }