骑行保存数据改成同步

This commit is contained in:
lishuo committed 2021-12-29 17:05:07 +08:00
1 parent f3f17c1256
commit d4fa2bbb69
6 files changed
+38 -29

No files matched your search

@@ -1148,8 +1148,8 @@ public BaseUIManager singleUIManager;
RecorderDataModel recorderData = cyclingController.recorderData;
tempRecordData.RiderDatas = recorderData.RiderDatas;
tempRecordData.selectParam = recorderData.selectParam;
tempRecordData.RouteId = recorderData.Competitionid;
tempRecordData.CompetitionId = mapRoute.Id;
tempRecordData.RouteId = mapRoute.Id;
tempRecordData.CompetitionId = recorderData.Competitionid;
tempRecordData.StartTime = startTime;
tempRecordData.ManufacturerId = recorderData.ManufacturerId;
tempRecordData.ManufacturerName = recorderData.ManufacturerName;
@@ -1161,7 +1161,7 @@ public BaseUIManager singleUIManager;
var tempContent = Newtonsoft.Json.JsonConvert.SerializeObject(tempRecordData);
System.IO.File.WriteAllText(filePath, tempContent);
}
int RankingId;
public void Save(double totalDistance)
{
ClearTempFile();
@@ -1182,6 +1182,7 @@ public BaseUIManager singleUIManager;
cyclingController.recorderData.ManufacturerId = ManufacturerId;
cyclingController.recorderData.ManufacturerName = ManufacturerName;
cyclingController.recorderData.DeviceNumber = DeviceNumber;
RankingId =cyclingController.recorderData.SaveWithLocalRecordAysnc(cyclingModel, selectParamModel, imageFileName, recordId, path);
//显示骑行结果(如果是比赛模式显示比赛最终排名)
if (cyclingModel != CyclingModel.Competition)
{
@@ -1190,7 +1191,6 @@ public BaseUIManager singleUIManager;
rs.InjectController(this);
rs.SetDataSource(cyclingController.recorderData);
}
cyclingController.recorderData.SaveWithLocalRecordAysnc(cyclingModel, selectParamModel, imageFileName, recordId, path);
}
public byte[] CaptureCamera()
{
@@ -61,7 +61,7 @@ namespace Assets.Scenes.Ride.Scripts
weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight;
//#if UNITY_EDITOR
power = 143;
power = 1443;
//#endif
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
}