小地图进度微调,人物脚本调整
This commit is contained in:
1 parent
8ca32cd1ae
commit
2b4b2c4f70
15 files changed
+3626
-3085
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
@@ -106,7 +107,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
|
||||
public int GlobalCyclingId { get; set; }
|
||||
|
||||
public void SaveLocal(CyclingModel cyclingModel, RouteResultParam selectParam, string imageName,string recordId)
|
||||
public void SaveWithLocalRecordAysnc(CyclingModel cyclingModel, RouteResultParam selectParam, string imageName,string recordId,string path)
|
||||
{
|
||||
Dictionary<MapInterruptRecord, List<string>> recordData = new Dictionary<MapInterruptRecord, List<string>>();
|
||||
if (RiderDatas.Count <= 0)
|
||||
@@ -181,7 +182,9 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
interruptRecord.MaxHeartRate = RiderDatas.Max(a => a._HeartRate.GetValueOrDefault(0));
|
||||
//service.CreateRecordCyclingData(interruptRecord);
|
||||
//保存骑行记录txt
|
||||
var path = Helper.GetDataDir("MapWorkoutRecords" + "/" + interruptRecord.Id);
|
||||
|
||||
//var path = Helper.GetDataDir("MapWorkoutRecords" + "/" + interruptRecord.Id);
|
||||
//var path = PFConstants.MapWorkoutRecordFolder + "/" + interruptRecord.Id;
|
||||
var fname = path + "/" + newFileName + ".txt";
|
||||
var files = new List<string>();
|
||||
using (var fs = new FileInfo(fname).OpenWrite())
|
||||
@@ -208,18 +211,18 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
|
||||
recordData.Add(interruptRecord, files);
|
||||
|
||||
SaveDataAysnc(recordData);
|
||||
SaveDataAysnc(recordData, path);
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="base64Image"></param>
|
||||
/// <returns></returns>
|
||||
public void SaveDataAysnc(Dictionary<MapInterruptRecord, List<string>> data)
|
||||
public void SaveDataAysnc(Dictionary<MapInterruptRecord, List<string>> data,string path)
|
||||
{
|
||||
if (data != null && data.Count > 0)
|
||||
{
|
||||
var path = Helper.GetDataDir("MapWorkoutRecords");
|
||||
//var path = Helper.GetDataDir("MapWorkoutRecords");
|
||||
Task.Run(() => {
|
||||
var record = data.FirstOrDefault();
|
||||
MapInterruptRecordApi service = new MapInterruptRecordApi();
|
||||
@@ -228,7 +231,6 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
//删除文件
|
||||
try
|
||||
{
|
||||
path = path + "/" + record.Key.Id;
|
||||
if (result.result && Directory.Exists(path))
|
||||
{
|
||||
Helper.DelectDir(path);
|
||||
|
||||
Reference in new issue
Block a user