TestBleConnect.cs 625 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class TestBleConnect : MonoBehaviour
  7. {
  8. public static TestBleConnect ins;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. ins = this;
  13. }
  14. // Update is called once per frame
  15. private void OnDestroy()
  16. {
  17. if (ins == this) ins = null;
  18. }
  19. public static void Log(string msg)
  20. {
  21. if (ins) ins.transform.Find("Scroll View/Viewport/Content/Text").GetComponent<Text>().text += DateTime.Now.ToString() + "\n" + msg + "\n";
  22. }
  23. }