| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- /*蓝牙持有者,算是蓝牙模块的管理者,内含调试界面 */
- public class BluetoothHolder : MonoBehaviour
- {
- bool debug = false;
- public static BluetoothHolder ins;
- public static void Init()
- {
- if (!BluetoothHolder.ins) {
- GameObject bluetoothHolder = Resources.Load<GameObject>("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();
- // transform.Find("Objects").gameObject.SetActive(true);
- }
- public void openDebug() {
- this.transform.Find("Canvas").gameObject.SetActive(true);
- }
- public void CloseDebug() {
- this.transform.Find("Canvas").gameObject.SetActive(false);
- }
- public void ClearCalibrateGuide() {
- UserSettings.ins.deviceCalibrateGuideFinish = false;
- UserSettings.ins.Save();
- }
- public void SetArrowWeight(InputField inputField) {
- string text = inputField.text;
- CommonConfig.arrowWeight = float.Parse(text);
- }
- }
|