lvjincheng 3 жил өмнө
parent
commit
512bf3d2c4

+ 6 - 3
Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

@@ -48,6 +48,9 @@ public class BluetoothAim : MonoBehaviour
 #if UNITY_STANDALONE_WIN
         new GameObject("BleUDP").AddComponent<BleUDP>();
 #endif
+
+        Debug.LogWarning("设置开始自动连接蓝牙");
+        userDoConnect = true;
     }
 
     void OnDestroy()
@@ -244,9 +247,9 @@ public class BluetoothAim : MonoBehaviour
             Debug.LogError(e.StackTrace);
             scanLock = false;
             canConnect = true;
-            // SetStatus(BluetoothStatusEnum.ConnectFail);
-            status = BluetoothStatusEnum.Connect;
-            userDoConnect = false;
+            SetStatus(BluetoothStatusEnum.ConnectFail);
+            // status = BluetoothStatusEnum.Connect;
+            // userDoConnect = false;
             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("ble-please-open-ble"));
         }
     }