diff --git a/Assets/CountDownAnimation.cs b/Assets/CountDownAnimation.cs index 2d556030..16bada60 100644 --- a/Assets/CountDownAnimation.cs +++ b/Assets/CountDownAnimation.cs @@ -13,12 +13,12 @@ public class CountDownAnimation : PFUIPanel { } - public void StartTime(UnityAction action) + public void StartTime(UnityAction action,UnityAction action2) { - HandleAnimation("5", action); + HandleAnimation("5", action, action2); } - void HandleAnimation(string s, UnityAction action) + void HandleAnimation(string s, UnityAction action, UnityAction action2) { var text = transform.Find("Text"); text.GetComponent().text = s; @@ -35,13 +35,17 @@ public class CountDownAnimation : PFUIPanel var flag = int.TryParse(s,out int a); if (flag) { + if (a == 1 && action2 != null) + { + action2.Invoke(); + } if (a - 1 == 0) { - HandleAnimation("Go", action); + HandleAnimation("Go", action, action2); } - else + else { - HandleAnimation((a - 1).ToString(), action); + HandleAnimation((a - 1).ToString(), action, action2); } } }; diff --git a/Assets/Scripts/Devices/Ble/Devices/FtmsRower.cs b/Assets/Scripts/Devices/Ble/Devices/FtmsRower.cs index 9b4a919b..59bc4ae9 100644 --- a/Assets/Scripts/Devices/Ble/Devices/FtmsRower.cs +++ b/Assets/Scripts/Devices/Ble/Devices/FtmsRower.cs @@ -74,7 +74,7 @@ namespace Assets.Scripts.Devices.Ble.Devices public void Reset() { - Debug.Log("发送重置命令"); + Debug.Log("发送重置命令"+this.controlPointCharacteristic.ToString()); hwInterface.WriteCharacteristic(this.controlPointCharacteristic, new byte[] { 0x01 }); } } diff --git a/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs b/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs index 195851c7..cd136960 100644 --- a/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs +++ b/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs @@ -347,7 +347,7 @@ namespace Assets.Scripts.Ble public void StopScan() { - bleMobileThread.Stop(); + bleMobileThread?.Stop(); } //发现服务列表 @@ -391,8 +391,12 @@ namespace Assets.Scripts.Ble //写入特征值 public void WriteCharacteristic(BleCharacteristicInfo characteristic, byte[] data) { - BluetoothLEHardwareInterface.WriteCharacteristic(characteristic.Peripheral.Address, characteristic.Service.Id.ToString(), characteristic.Id.ToString(), data, data.Length, false, (characteristicUUID) => { - + bool withResponse = false; +#if UNITY_IOS + withResponse = characteristic.Id.ToString().ToLower().Contains("2AD9".ToLower()); +#endif + BluetoothLEHardwareInterface.WriteCharacteristic(characteristic.Peripheral.Address, characteristic.Service.Id.ToString(), characteristic.Id.ToString(), data, data.Length, withResponse, (characteristicUUID) => { + Debug.Log("相应" + characteristicUUID); BluetoothLEHardwareInterface.Log("Write Succeeded"); }); } diff --git a/Assets/Scripts/UI/Prefab/BigMap/Item.cs b/Assets/Scripts/UI/Prefab/BigMap/Item.cs index 13f1e84f..96fa1e2e 100644 --- a/Assets/Scripts/UI/Prefab/BigMap/Item.cs +++ b/Assets/Scripts/UI/Prefab/BigMap/Item.cs @@ -73,6 +73,7 @@ public class Item : PFUIPanel, IPointerEnterHandler, IPointerExitHandler, IPoint SetRounded(hot, 17); //UIManager.AddEvent(this.gameObject, EventTriggerType.PointerClick, OnPointerClick); + transform.GetComponent