Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile

This commit is contained in:
Caiyanpeng committed 2021-08-26 09:29:42 +08:00
commit 723c881790
17 files changed
+8131 -58

No files matched your search

@@ -167,6 +167,15 @@ namespace Assets.Scripts.Ble
};
public static readonly IReadOnlyList<ServiceUuid> CyclingServices = ServiceUuids.Services.Where(s => s.IsCycling).ToList();
public static List<string> GetServiceUuidList()
{
List<string> list = new List<string>();
foreach (var item in Services)
{
list.Add(item.IdGuid.ToString());
}
return list;
}
public static ServiceUuid Get(byte[] type)
{
return ServiceUuids.Services.Single(s => s.IdByteArray == type);
@@ -66,7 +66,8 @@ namespace Assets.Scripts.Devices.Ble
}
public void StartWatcher() {
BluetoothLEHardwareInterface.ScanForPeripheralsWithServices(null, null, (address, name, rssi, bytes) =>
BluetoothLEHardwareInterface.ScanForPeripheralsWithServices(ServiceUuids.GetServiceUuidList().ToArray(), null, (address, name, rssi, bytes) =>
{
ScanInfoReceived?.Invoke(this, address, name, rssi, bytes);
}, true);
+1
View File
@@ -24,6 +24,7 @@ public class MainController : BaseScene
#if UNITY_ANDROID || UNITY_IOS
transform.GetComponent<CanvasScaler>().referenceResolution = new Vector2(844, 390);
transform.Find("Panel").GetComponent<RectTransform>().sizeDelta = new Vector2(844, 390);
transform.Find("ModalPanel").GetComponent<RectTransform>().sizeDelta = new Vector2(844, 390);
#endif
App.MainDeviceAdapter.StartScan();
}
@@ -1,6 +1,7 @@
using Assets.Scenes.Ride.Scripts.Model;
using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace Assets.Scenes.Ride.Scripts
@@ -24,7 +25,7 @@ namespace Assets.Scenes.Ride.Scripts
Title = transform.Find("Title").GetComponent<Text>();
OnlineUserNum = transform.Find("NearByView/OnlineUserNum").GetComponent<Text>();
pageSize = 999;//开启无线下拉
pageSize = 5;//开启无线下拉
}
protected override void CreateList()
{
@@ -49,6 +50,7 @@ namespace Assets.Scenes.Ride.Scripts
Create(nearList[i]);
}
}
private void Create(NearRiderModel item)
{
var rankingList = FindObjectsOfType<NearByItemScript>();