合并
This commit is contained in:
@@ -18,8 +18,6 @@ namespace AibisDream
|
||||
private const string DataPrefix = "$data.";
|
||||
private const int MaxSaveNum = 200;
|
||||
|
||||
private static readonly string SaveFilePath = Application.streamingAssetsPath + "/SaveFiles";
|
||||
|
||||
#region 存储部分
|
||||
|
||||
private readonly Dictionary<string, object> _variableDict = new();
|
||||
@@ -226,7 +224,8 @@ namespace AibisDream
|
||||
|
||||
// 保存版本号
|
||||
saveFile["version"] = $"Ver.{Application.version}";
|
||||
|
||||
saveFile["time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
// 保存系统数据
|
||||
saveFile["systemData"] = _dataContainer.SaveAsJson();
|
||||
|
||||
@@ -242,10 +241,10 @@ namespace AibisDream
|
||||
DeleteOldSave();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private void DeleteOldSave()
|
||||
{
|
||||
var fileList = Directory.GetFiles(SaveFilePath);
|
||||
var fileList = Directory.GetFiles(ConstRef.SaveFilePath);
|
||||
if (fileList.Length > MaxSaveNum)
|
||||
{
|
||||
var sorted = fileList.OrderByDescending(f => f).ToArray();
|
||||
@@ -291,7 +290,7 @@ namespace AibisDream
|
||||
}
|
||||
|
||||
return
|
||||
$"{SaveFilePath}/{DateTime.Now:yyyyMMdd_HHmmss}_{GameManager.Instance.GetSceneSoName()}_{gameStage}";
|
||||
$"{ConstRef.SaveFilePath}/{DateTime.Now:yyyy-M-d}_{GameManager.Instance.GetSceneSoName()}_{gameStage}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user