上传记录增加本地保存逻辑
This commit is contained in:
1 parent
614d067d25
commit
9993752ff5
6 files changed
+4200
-3948
No files matched your search
@@ -302,7 +302,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
var rs = resultPanel.GetComponent<ResultPanelScript>();
|
||||
rs.InjectController(this);
|
||||
rs.SetDataSource(cyclingController.recorderData);
|
||||
cyclingController.recorderData.SaveData(cyclingModel, selectParamModel, imageFileName);
|
||||
var localData = cyclingController.recorderData.SaveLocal(cyclingModel, selectParamModel, imageFileName);
|
||||
//异步上传
|
||||
cyclingController.recorderData.SaveDataAysnc(localData);
|
||||
}
|
||||
|
||||
protected string CaptureCamera(Camera camera, Rect rect)
|
||||
@@ -330,7 +332,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
GameObject.Destroy(rt);
|
||||
// 最后将这些纹理数据,成一个图片文件
|
||||
byte[] bytes = screenShot.EncodeToPNG();
|
||||
string filename = Application.dataPath + "/" + Guid.NewGuid().ToString() + ".png";
|
||||
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user