From 6501284bbcd8a4e4a07d8ecb4116858df8e8b060 Mon Sep 17 00:00:00 2001 From: CaiYanPeng Date: Thu, 30 Sep 2021 15:23:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E7=90=83=E6=94=B6=E8=97=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8Cios=20=E8=93=9D=E7=89=99=E6=9C=89=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E5=A4=84=E7=90=86=EF=BC=8C=E5=88=92=E8=88=B9?= =?UTF-8?q?=E6=9C=BA=E5=80=92=E8=AE=A1=E6=97=B61=E6=97=B6=E9=87=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/CountDownAnimation.cs | 16 ++++++++++------ Assets/Scripts/Devices/Ble/Devices/FtmsRower.cs | 2 +- .../Devices/Ble/mobile/BleMobileInterface.cs | 10 +++++++--- Assets/Scripts/UI/Prefab/BigMap/Item.cs | 1 + Assets/Scripts/UI/Prefab/MainNav.cs | 4 ++++ Assets/Scripts/UI/Prefab/MapList/MapItem.cs | 3 +++ .../Scripts/UI/Prefab/Panel/RowerHomeScript.cs | 8 ++++++++ Assets/Scripts/UIManager.cs | 4 ++-- ProjectSettings/GraphicsSettings.asset | 1 - 9 files changed, 36 insertions(+), 13 deletions(-) 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