骑行和赛事分享&集合正在骑行的人数

This commit is contained in:
lishuo committed 2021-12-27 18:29:23 +08:00
1 parent 2743c8d185
commit ffc98f1a58
23 files changed
+3736 -1103

No files matched your search

@@ -1,6 +1,8 @@
using Assets.Scripts;
using Assets.Scenes.Ride.Scripts;
using Assets.Scripts;
using Assets.Scripts.Apis.Models;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -13,6 +15,7 @@ public class NewRouteDetailController : PFUIPanel
Dictionary<string, Texture> caches;
GameObject map;
ScrollRect scroll;
List<int> routeIds { get; set; }
protected override void Awake()
{
@@ -53,7 +56,7 @@ public class NewRouteDetailController : PFUIPanel
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
BindHeadImage();
}
float timer = 1f;
// Update is called once per frame
void Update()
{
@@ -72,6 +75,18 @@ public class NewRouteDetailController : PFUIPanel
OnEndDrag(null);
}
}
timer -= Time.deltaTime;
while (timer < 0)
{
var list = MapUDPService.GetAllOnlineUserList();
if (list.Count > 0 && routeIds != null)
{
//当前集合骑行人数
var currentUserCount = list.Where(c => routeIds.Contains(c.RouteId)).Count();
Debug.Log($"当前集合骑行人数{currentUserCount}");
}
timer += 1f;
}
}
MapRouteAreaItem area;
int pageIndex = 0, pageSize = 10;
@@ -137,9 +152,10 @@ public class NewRouteDetailController : PFUIPanel
var res = await ConfigHelper.mapApi.GetMapRouteAreaDetailList(area.Id, pageIndex, pageSize);
if (res.result)
{
if (res.data.Count > 0)
if (res.data.RouteList.Count > 0)
{
DisplayMaps(res.data);
DisplayMaps(res.data.RouteList);
routeIds = res.data.RouteIds;
}
else
{