using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BluetoothHolder : MonoBehaviour { bool debug = true; public static BluetoothHolder ins; public static void Init() { if (!BluetoothHolder.ins) { GameObject bluetoothHolder = Resources.Load("Prefabs/BluetoothHolder"); GameObject.Instantiate(bluetoothHolder); } } void Awake() { if (ins) { Destroy(this.gameObject); } else { ins = this; DontDestroyOnLoad(this.gameObject); } } void Start() { if (!debug) { this.transform.Find("CanvasForOpenDebug").gameObject.SetActive(false); } CloseDebug(); } public void openDebug() { this.transform.Find("Canvas").gameObject.SetActive(true); this.transform.Find("Objects").gameObject.SetActive(true); } public void CloseDebug() { this.transform.Find("Canvas").gameObject.SetActive(false); this.transform.Find("Objects").gameObject.SetActive(false); } }