BluetoothHolder.cs 914 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class BluetoothHolder : MonoBehaviour
  6. {
  7. bool debug = true;
  8. public static BluetoothHolder ins;
  9. void Awake()
  10. {
  11. if (ins)
  12. {
  13. Destroy(this.gameObject);
  14. } else {
  15. DontDestroyOnLoad(this.gameObject);
  16. }
  17. }
  18. void Start() {
  19. ins = this;
  20. if (!debug) {
  21. this.transform.Find("CanvasForOpenDebug").gameObject.SetActive(false);
  22. }
  23. CloseDebug();
  24. }
  25. public void openDebug() {
  26. this.transform.Find("Canvas").gameObject.SetActive(true);
  27. this.transform.Find("Objects").gameObject.SetActive(true);
  28. }
  29. public void CloseDebug() {
  30. this.transform.Find("Canvas").gameObject.SetActive(false);
  31. this.transform.Find("Objects").gameObject.SetActive(false);
  32. }
  33. }