diff --git a/Assets/Resources/Images/Rower/搜索.png b/Assets/Resources/Images/Rower/搜索.png new file mode 100644 index 00000000..76afa77a Binary files /dev/null and b/Assets/Resources/Images/Rower/搜索.png differ diff --git a/Assets/Resources/Images/Rower/搜索.png.meta b/Assets/Resources/Images/Rower/搜索.png.meta new file mode 100644 index 00000000..7d516c51 --- /dev/null +++ b/Assets/Resources/Images/Rower/搜索.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 23324df2738e17840a880b3a6a667a98 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/UI/Prefab/Device/Mobile/ConnectDeviceModal.prefab b/Assets/Resources/UI/Prefab/Device/Mobile/ConnectDeviceModal.prefab index 07b44838..92f18830 100644 --- a/Assets/Resources/UI/Prefab/Device/Mobile/ConnectDeviceModal.prefab +++ b/Assets/Resources/UI/Prefab/Device/Mobile/ConnectDeviceModal.prefab @@ -823,6 +823,174 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7779863355442684396 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7034836054261949127} + - component: {fileID: 6143368985754638542} + - component: {fileID: 5753665062704233989} + - component: {fileID: 1495845730394678308} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7034836054261949127 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7779863355442684396} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4661211349328450780} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: -16} + m_SizeDelta: {x: 192, y: 26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6143368985754638542 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7779863355442684396} + m_CullTransparentMesh: 0 +--- !u!114 &5753665062704233989 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7779863355442684396} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 1db9e217733971041be26b076fda6083, type: 3} + m_FontSize: 22 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: NO DEVICE +--- !u!114 &1495845730394678308 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7779863355442684396} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e47f6ee11b78f3247a0b474b6c36e2cd, type: 3} + m_Name: + m_EditorClassIdentifier: + key: +--- !u!1 &7796194410704820496 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4661211349328450780} + - component: {fileID: 5386702751970923277} + - component: {fileID: 6255635068988837825} + m_Layer: 5 + m_Name: Error + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &4661211349328450780 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7796194410704820496} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7034836054261949127} + - {fileID: 1853356364457434975} + m_Father: {fileID: 5111540946519637648} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -4.600006, y: 25.800003} + m_SizeDelta: {x: 50, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5386702751970923277 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7796194410704820496} + m_CullTransparentMesh: 0 +--- !u!114 &6255635068988837825 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7796194410704820496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 23324df2738e17840a880b3a6a667a98, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &7824156360689418142 GameObject: m_ObjectHideFlags: 0 @@ -1023,6 +1191,98 @@ MonoBehaviour: m_OnValueChanged: m_PersistentCalls: m_Calls: [] +--- !u!1 &8037773402551538084 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1853356364457434975} + - component: {fileID: 8162886766775582271} + - component: {fileID: 2416531608984966904} + - component: {fileID: 6648807303715948149} + m_Layer: 5 + m_Name: Text (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1853356364457434975 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8037773402551538084} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4661211349328450780} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: -0.42, y: -42} + m_SizeDelta: {x: 487.94348, y: 24} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8162886766775582271 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8037773402551538084} + m_CullTransparentMesh: 0 +--- !u!114 &2416531608984966904 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8037773402551538084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.36078432, g: 0.36078432, b: 0.43137255, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 1db9e217733971041be26b076fda6083, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Please make sure the device is powered on an awakened +--- !u!114 &6648807303715948149 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8037773402551538084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e47f6ee11b78f3247a0b474b6c36e2cd, type: 3} + m_Name: + m_EditorClassIdentifier: + key: --- !u!1 &8099950033695761744 GameObject: m_ObjectHideFlags: 0 @@ -1358,6 +1618,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 2253444633616264453} + - {fileID: 4661211349328450780} m_Father: {fileID: 8260988677505792498} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Resources/UI/language.json b/Assets/Resources/UI/language.json index 07f970da..09e6a2bc 100644 --- a/Assets/Resources/UI/language.json +++ b/Assets/Resources/UI/language.json @@ -367,7 +367,8 @@ "Please check the network status!": "请检查网络连接是否正常!", "FINISH": "终点", "Continue the game?": "有中断的划船记录,是否继续?", - "Save the game?": "有中断的划船记录,是否保存?" + "Save the game?": "有中断的划船记录,是否保存?", + "Please make sure the device is powered on an awakened": "请确保设备有电且已唤醒" }, "en": { "HOT ROUTES": "HOT ROUTES", @@ -729,6 +730,7 @@ "Please check the network status!": "Please check if the network connection is normal!", "FINISH": "FINISH", "Continue the game?": "Continue the game?", - "Save the game?": "Save the game?" + "Save the game?": "Save the game?", + "Please make sure the device is powered on an awakened": "Please make sure the device is powered on an awakened" } } diff --git a/Assets/Scripts/Devices/Ble/Characteristic/C2RowerData.cs b/Assets/Scripts/Devices/Ble/Characteristic/C2RowerData.cs index 0f76924d..0de5437f 100644 --- a/Assets/Scripts/Devices/Ble/Characteristic/C2RowerData.cs +++ b/Assets/Scripts/Devices/Ble/Characteristic/C2RowerData.cs @@ -27,7 +27,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic _isEnabled = value; if (EnableChanged != null) { - EnableChanged(_isEnabled, new EventArgs()); + EnableChanged(_isEnabled, null); } } } @@ -46,7 +46,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic _pullValue = value; if (this.PullChanged != null) { - this.PullChanged(this, new EventArgs()); + this.PullChanged(this, null); } } } @@ -68,15 +68,15 @@ namespace Assets.Scripts.Devices.Ble.Characteristic else if (data[0] == 0x3d) { //老款表头不支持 - List r = new List(); + //List r = new List(); for (int i = 3; i < data.Length; i += 2) { ushort pull = data[i] < 5 ? (ushort)0 : Convert.ToUInt16(Math.Round(LbsToNewton(data[i], true))); - r.Add(pull); + //r.Add(pull); PullValue = pull; } - Debug.Log("拉力曲线:" + string.Join(",", r)); + // Debug.Log("拉力曲线:" + string.Join(",", r)); } else if (data[0] == 0x31) { @@ -102,11 +102,12 @@ namespace Assets.Scripts.Devices.Ble.Characteristic var time = ((data[3] << 16) + (data[2] << 8) + data[1]) / 100; Debug.Log("划船时间" + time); isReadyStatus = data[9] == 0; - if (RowerResChanged != null) - { - RowerResChanged.Invoke(data[19], new EventArgs()); - } + var hasChanged = data[19] != ResistanceLevel; ResistanceLevel = data[19]; + if (RowerResChanged != null && hasChanged) + { + RowerResChanged.Invoke(this, null); + } //isReadyStatus = data[2] == 1 || data[2] == 129; } else if (data[0] == 0x32) @@ -163,7 +164,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic { if (_totalDistance == 0 && value != 0 && StartEvent != null) { - StartEvent.Invoke(null, new EventArgs()); + StartEvent.Invoke(this, null); } _totalDistance = value; } diff --git a/Assets/Scripts/Devices/Ble/Characteristic/FtmsRowerData.cs b/Assets/Scripts/Devices/Ble/Characteristic/FtmsRowerData.cs index f109d75e..458c0a32 100644 --- a/Assets/Scripts/Devices/Ble/Characteristic/FtmsRowerData.cs +++ b/Assets/Scripts/Devices/Ble/Characteristic/FtmsRowerData.cs @@ -38,7 +38,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic { if (_instantaneousPace == 0 && value != 0 && StartEvent != null) { - StartEvent.Invoke(null, new EventArgs()); + StartEvent.Invoke(this, null); } _instantaneousPace = value; } @@ -104,7 +104,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic _pullValue = value; if (this.PullChanged != null) { - this.PullChanged(this, new EventArgs()); + this.PullChanged(this, null); } } } @@ -200,7 +200,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic var device = App.MainDeviceAdapter.GetDevices().FirstOrDefault(d => (d.State == DeviceState.Connected) && d.Sensor == SensorType.Rower); if (resChanged && device != null && deviceNamePool.FirstOrDefault(x => device.Name.ToLower().Contains(x.ToLower())) == null && RowerResChanged != null) { - RowerResChanged.Invoke(this.commonRes, null); + RowerResChanged.Invoke(this, null); } b += this.SizeOfDataForFlag(RowerDataFlag.ResistanceLevel); } @@ -241,7 +241,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic var device = App.MainDeviceAdapter.GetDevices().FirstOrDefault(d => (d.State == DeviceState.Connected) && d.Sensor == SensorType.Rower); if (thinkResChanged && device != null && deviceNamePool.FirstOrDefault(x=>device.Name.ToLower().Contains(x.ToLower()))!=null && RowerResChanged != null) { - RowerResChanged.Invoke(this.thinkRes, null); + RowerResChanged.Invoke(this, null); } b += this.SizeOfDataForFlag(RowerDataFlag.ThinkDragFactor); } @@ -254,6 +254,8 @@ namespace Assets.Scripts.Devices.Ble.Characteristic tempPullList.Add(val); PullValue = val; } + Debug.Log("拉力列表:" + string.Join(",", tempPullList)); + if (pullList == null) pullList = new List(); foreach (var pull in tempPullList) { @@ -269,7 +271,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic pullList.Add(pull); } tempPullList.Clear(); - //Debug.Log("拉力:" + string.Join(",",list)); + } } List pullList { get; set; } diff --git a/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs b/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs index b2c1a994..d35ebd46 100644 --- a/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs +++ b/Assets/Scripts/Devices/Ble/mobile/BleMobileInterface.cs @@ -116,6 +116,10 @@ namespace Assets.Scripts.Ble private void ManagerStatusChanged(BleMobileThread sender, WclBleManagerStatus status) { this.BleState = BleMobileInterface.StateFromNativeState(status); + if (this.BleState == BleState.Off) + { + ClearAllCallbacks(); + } } private void WatcherScanInfoReceived(BleMobileThread sender, string address, string name, int rssi,string[] uuids) @@ -348,6 +352,7 @@ namespace Assets.Scripts.Ble BluetoothLEHardwareInterface.DisconnectPeripheral(peripheral.Address, (address) => { Debug.Log("断开回调"+ address); + PeripheralDisconnected(address,peripheral); peripheralDisconnectedEvent(this, peripheral, null, true); callback?.Invoke(); }); @@ -374,6 +379,17 @@ namespace Assets.Scripts.Ble { bleMobileThread?.Stop(); } + + public void ClearAllCallbacks() + { + callbacks?.Clear(); + servicesCallbacks?.Clear(); + characteristicNotificationCallbacks?.Clear(); + characteristicReadCallbacks?.Clear(); + characteristicsDiscoveredCallbacks?.Clear(); + _discoveredCallback = null; + _pCache?.Clear(); + } //发现服务列表 public void DiscoverServices(BlePeripheralInfo peripheral, Action>> callback) diff --git a/Assets/Scripts/UI/Control/PFUISlider.cs b/Assets/Scripts/UI/Control/PFUISlider.cs index c394cc9d..807ee35f 100644 --- a/Assets/Scripts/UI/Control/PFUISlider.cs +++ b/Assets/Scripts/UI/Control/PFUISlider.cs @@ -50,6 +50,8 @@ public class PFUISlider : MonoBehaviour } public void SetValue(float a) { + a = a > 1 ? 1 : a; + a = a < 0 ? 0 : a; slider.value = a; slider.onValueChanged?.Invoke(a); } diff --git a/Assets/Scripts/UI/Prefab/Device/ConnectDeviceModal.cs b/Assets/Scripts/UI/Prefab/Device/ConnectDeviceModal.cs index 951656b1..74547532 100644 --- a/Assets/Scripts/UI/Prefab/Device/ConnectDeviceModal.cs +++ b/Assets/Scripts/UI/Prefab/Device/ConnectDeviceModal.cs @@ -44,6 +44,7 @@ public class ConnectDeviceModal : PFUIPanel private Dictionary deviceList; private Text noDevice,Title; private RectTransform searchIconRect; + private GameObject deviceNotFound; protected override void Awake() { @@ -52,6 +53,7 @@ public class ConnectDeviceModal : PFUIPanel deviceList = new Dictionary(); var container = this.transform.Find("GameObject"); + deviceNotFound = container.Find("Panel/Error").gameObject; var closeBtn = container.Find("CloseBtn"); Logo = container.Find("Logo").GetComponent(); Title = container.Find("Title").GetComponent(); @@ -259,6 +261,7 @@ public class ConnectDeviceModal : PFUIPanel //如果没有可连接的设备按钮只读 connectBtn.mButton.enabled = deviceList.Count > 0; connectBtn.mButton.interactable = deviceList.Count > 0; + deviceNotFound.SetActive(deviceList.Count <= 0); } } //选中需要连接的设备 diff --git a/Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs b/Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs index b4b3aaaa..0a2e0247 100644 --- a/Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs +++ b/Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs @@ -466,6 +466,10 @@ public class RowerHomeScript : PFUIPanel int truelyTime = 0; private void StartFunc(object sender, EventArgs e) { + var rowdata = (IRowerCommonData)sender; + if (rowdata != RowerData) + return; + Debug.Log($"开始了:{openTimer}"); if (UIManager.Instance.confirm != null && UIManager.Instance.confirm.IsActive()) { @@ -626,6 +630,7 @@ public class RowerHomeScript : PFUIPanel private void Init() { + pointCount = 0; print("初始化"); if (Rower != null) { @@ -734,20 +739,18 @@ public class RowerHomeScript : PFUIPanel transform.Find("ResBar/BtnSub").GetComponent