Przeglądaj źródła

蓝牙电量请求问题

lvjincheng 4 lat temu
rodzic
commit
844f527693

+ 1 - 1
Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

@@ -129,7 +129,7 @@ public class BluetoothAim : MonoBehaviour
                 CallDelay(1, OpenInfrared);
                 CallDelay(2, OpenReceiveData);
                 CallDelay(3, delegate() {
-                    WriteData(SceneManager.GetActiveScene().name == "Game" ? "b" :"B");
+                    WriteData(SceneManager.GetActiveScene().name.StartsWith("Game") ? "b" :"B");
                 });
             };
             bluetoothHelper.OnConnectionFailed += (BluetoothHelper helper) =>

+ 1 - 1
Assets/BowArrow/Scripts/View/DeviceBatteryView.cs

@@ -51,7 +51,7 @@ public class DeviceBatteryView : MonoBehaviour
     {
         try {
             if (BluetoothAim.ins.hasData && JC.CS.Utility.GetTimestamp() - BluetoothAim.ins.hasDataTime > 3000) {
-                BluetoothAim.ins.WriteData(SceneManager.GetActiveScene().name == "Game" ? "b" :"B");
+                BluetoothAim.ins.WriteData(SceneManager.GetActiveScene().name.StartsWith("Game") ? "b" :"B");
             }
         } catch (Exception) {}
     }