骑行界面按钮替换,界面&逻辑调整

This commit is contained in:
lishuo committed 2021-04-29 18:07:30 +08:00
1 parent 9993752ff5
commit ae55258b9b
28 files changed
+11438 -8086

No files matched your search

@@ -290,7 +290,12 @@ public class CyclingController : DeviceServiceMonoBase
{
isQuit = true;
isStart = false;
string imageFileName = CaptureCamera(Camera.main, new Rect(Screen.width * 0f, Screen.height * 0f, Screen.width * 0.5f, Screen.height * 0.5f));
string recordId = Guid.NewGuid().ToString();
var path = Helper.GetDataDir("MapWorkoutRecords/"+ recordId);
string imageFileName = path +"/"+ Guid.NewGuid().ToString() + ".png";
CaptureCamera(Camera.main, new Rect(Screen.width * 0f, Screen.height * 0f, Screen.width * 0.5f, Screen.height * 0.5f), imageFileName);
cyclingController.recorderData.StartTime = startTime;
cyclingController.recorderData.IsCompleted = totalDistance == mapData.TotalDistance;
cyclingController.recorderData.EndDistance = totalDistance;
@@ -302,12 +307,10 @@ public class CyclingController : DeviceServiceMonoBase
var rs = resultPanel.GetComponent<ResultPanelScript>();
rs.InjectController(this);
rs.SetDataSource(cyclingController.recorderData);
var localData = cyclingController.recorderData.SaveLocal(cyclingModel, selectParamModel, imageFileName);
//异步上传
cyclingController.recorderData.SaveDataAysnc(localData);
cyclingController.recorderData.SaveLocal(cyclingModel, selectParamModel, imageFileName, recordId);
}
protected string CaptureCamera(Camera camera, Rect rect)
protected void CaptureCamera(Camera camera, Rect rect,string fileName)
{
// 创建一个RenderTexture对象
RenderTexture rt = new RenderTexture((int)rect.width, (int)rect.height, 0);
@@ -333,11 +336,10 @@ public class CyclingController : DeviceServiceMonoBase
// 最后将这些纹理数据,成一个图片文件
byte[] bytes = screenShot.EncodeToPNG();
var path = Helper.GetDataDir("MapWorkoutRecords/images");
string filename = path + "/" + Guid.NewGuid().ToString() + ".png";
System.IO.File.WriteAllBytes(filename, bytes);
//var path = Helper.GetDataDir("MapWorkoutRecords/images");
//string filename = path + "/" + Guid.NewGuid().ToString() + ".png";
System.IO.File.WriteAllBytes(fileName, bytes);
//Debug.Log(string.Format("截屏了一张照片: {0}", filename));
return filename;
}
public Vector2d GetCenterCoordinate()