骑行loading&赛事计时板调整
This commit is contained in:
1 parent
0500736fff
commit
b8a3a30629
15 files changed
+248
-115
No files matched your search
@@ -41,8 +41,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (count >= 0 && !competitionModel.recorderData.Saved)
|
||||
{
|
||||
ShowCountDown(count, App.GetLocalString("Get Ready!"));//显示倒计时面板信息
|
||||
Timer.gameObject.SetActive(false);
|
||||
TimerTitle.gameObject.SetActive(false);
|
||||
//Timer.gameObject.SetActive(false);
|
||||
//TimerTitle.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//显示倒计时面板信息
|
||||
ShowCountDown(s.Item1, App.GetLocalString("Time Limit"));
|
||||
#else
|
||||
ShowCountDown(s.Item1, "Get The First Place. Time Limit");
|
||||
ShowCountDown(s.Item1, App.GetLocalString("Get The First Place. Time Limit"));
|
||||
#endif
|
||||
}
|
||||
else if (s.Item1 >= 0)
|
||||
@@ -66,19 +66,19 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
ShowCountDown(s.Item1, App.GetLocalString("Remaining Time"));
|
||||
}
|
||||
//显示当前选手骑行时间
|
||||
Timer.gameObject.SetActive(true);
|
||||
TimerTitle.gameObject.SetActive(true);
|
||||
Timer.text = Helper.FormatTicks(s.Item2);// Helper.FormatTicks(cyclingController.currentPlayer.TotalTicks);
|
||||
//CountTimer.gameObject.SetActive(true);
|
||||
//TimerTitle.gameObject.SetActive(true);
|
||||
CountTimer.text = Helper.FormatTicks(s.Item2);// Helper.FormatTicks(cyclingController.currentPlayer.TotalTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowCountDown(int count, string text)
|
||||
{
|
||||
Title.text = text;
|
||||
TimerTitle.text = text;
|
||||
if (count >= 0)
|
||||
{
|
||||
CountTimer.text = Helper.FormatTicks(count);
|
||||
Timer.text = Helper.FormatTicks(count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,6 +267,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
|
||||
public class TempRecordData
|
||||
{
|
||||
public int CompetitionId { get; set; }
|
||||
public int RouteId { get; set; }
|
||||
public RouteResultParam selectParam { get; set; }
|
||||
public double CurrentRouteStartDistance { get; set; }
|
||||
|
||||
@@ -428,6 +428,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var msgs = RemoveExceptionData(mes);
|
||||
//LastActiveTime = DateTime.Now;
|
||||
var ids = msgs.Where(m => onlineUsers.All(u => u.Id != m.MemberId)).Select(m => m.MemberId);
|
||||
var routeIds = msgs.Where(m => onlineUsers.All(u => u.Id != m.MemberId)).Select(m => m.RouteId);
|
||||
if (ids.Any())
|
||||
{
|
||||
List<int> notCachedIds = new List<int>();
|
||||
@@ -447,6 +448,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (notCachedIds.Count > 0)
|
||||
{
|
||||
var rangeUser = ConfigHelper.mapApi.GetOnlineUserInfo(ids).data;
|
||||
var rangeRoute = ConfigHelper.mapApi.GetMapRouteInfo(routeIds).data;
|
||||
App.RouteList.AddRange(rangeRoute);
|
||||
onlineUsers.AddRange(rangeUser);
|
||||
App.userList.AddRange(rangeUser);
|
||||
}
|
||||
@@ -454,10 +457,16 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
foreach (var user in onlineUsers)
|
||||
{
|
||||
var item = msgs.FirstOrDefault(u => u.MemberId == user.Id);
|
||||
var route = App.RouteList.Where(c => c.Id == item.RouteId).FirstOrDefault();
|
||||
if (route != null)
|
||||
{
|
||||
user.RouteName = route.NickName;
|
||||
}
|
||||
if (item != null)
|
||||
{
|
||||
user.LastActiveTime = DateTime.Now;
|
||||
user.RouteId = item.RouteId;
|
||||
|
||||
user.Point = item.Point;
|
||||
user.IsCompleted = item.IsCompleted;
|
||||
//user.exit = item.exit;
|
||||
|
||||
@@ -92,8 +92,8 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
if (App.tempRecordData != null)
|
||||
{
|
||||
selectParamModel = App.tempRecordData.selectParam;
|
||||
competitionId = selectParamModel.CompetitionId ?? 0;
|
||||
routeId = selectParamModel.RouteId ?? 0;
|
||||
competitionId = App.tempRecordData.CompetitionId;
|
||||
routeId = App.tempRecordData.RouteId;
|
||||
}
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
@@ -560,8 +560,10 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//初始比赛
|
||||
private IEnumerator InitRace()
|
||||
{
|
||||
yield return new WaitForSeconds(1);
|
||||
yield return null;//new WaitForSeconds(1);
|
||||
UnityEngine.Debug.Log($"TEST:{routeId}");
|
||||
mapRoute = mapApi.GetById(routeId).data;
|
||||
|
||||
var mapCompetitionApi = new MapCompetitionApi();
|
||||
competition = mapCompetitionApi.GetById(competitionId).data;
|
||||
loadingController.Init();//初始化loading页面
|
||||
@@ -602,7 +604,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
EndDistance = 0,
|
||||
RankingsId = new List<string>(),
|
||||
OnlineUserId = 0,
|
||||
RouteId = App.RouteIdParam
|
||||
RouteId = routeId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1146,7 +1148,8 @@ public BaseUIManager singleUIManager;
|
||||
RecorderDataModel recorderData = cyclingController.recorderData;
|
||||
tempRecordData.RiderDatas = recorderData.RiderDatas;
|
||||
tempRecordData.selectParam = recorderData.selectParam;
|
||||
tempRecordData.RouteId = mapRoute.Id;
|
||||
tempRecordData.RouteId = recorderData.Competitionid;
|
||||
tempRecordData.CompetitionId = mapRoute.Id;
|
||||
tempRecordData.StartTime = startTime;
|
||||
tempRecordData.ManufacturerId = recorderData.ManufacturerId;
|
||||
tempRecordData.ManufacturerName = recorderData.ManufacturerName;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
DrawMapRouteAsync(route.Id);
|
||||
AddProcess(10);
|
||||
//查询排行榜
|
||||
var list = mapApi.GetRouteRanking(App.RouteIdParam, "1", 0, 99999, "");
|
||||
var list = mapApi.GetRouteRanking(route.Id, "1", 0, 10, "");
|
||||
if (list.result)
|
||||
{
|
||||
if (list.data.list.Count > 10)
|
||||
|
||||
Reference in new issue
Block a user