using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class DeviceReconnectView : MonoBehaviour { [SerializeField] GameObject btnConnectBow; [SerializeField] GameObject btnConnectArrow; [SerializeField] Button btnClose; static DeviceReconnectView ins; public Action onComplete = null; public static GameObject Show() { if (SceneManager.GetActiveScene().name != "Game") return null; try { GameObject view = Resources.Load("Prefabs/Views/DeviceReconnectView"); return GameObject.Instantiate(view); } catch (Exception) {} return null; } void Awake() { if (ins) { Destroy(this.gameObject); } else { ins = this; } } void Start() { InitBtnForConnect(); GameMgr.ins.addLockerForGamePause(this); //debug不做连接检测 Destroy(this.gameObject); if (onComplete != null) { onComplete(); } } void OnDestroy() { GameMgr.ins.removeLockerForGamePause(this); } void Update() { UpdateBtnForConnect(); btnClose.interactable = BluetoothStatus.IsAllConnected(); } void InitBtnForConnect() { btnConnectBow.GetComponent