加入用户最近100场战绩记录并实现展示
This commit is contained in:
@@ -263,20 +263,21 @@ public class UI_Panel_Mail : MonoBehaviour
|
||||
isReceived = mail.isReceived
|
||||
});
|
||||
}
|
||||
var json = JsonUtility.ToJson(data, true);
|
||||
File.WriteAllText(GetSavePath(), json);
|
||||
SecureSaveVault.SaveJson("mail_state", "runtime", data, GetLegacySavePath());
|
||||
}
|
||||
|
||||
MailSaveData LoadMailState()
|
||||
{
|
||||
var path = GetSavePath();
|
||||
if (!File.Exists(path)) return null;
|
||||
var json = File.ReadAllText(path);
|
||||
if (string.IsNullOrEmpty(json)) return null;
|
||||
return JsonUtility.FromJson<MailSaveData>(json);
|
||||
MailSaveData data;
|
||||
if (!SecureSaveVault.TryLoadJson("mail_state", "runtime", out data, GetLegacySavePath()))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
string GetSavePath()
|
||||
string GetLegacySavePath()
|
||||
{
|
||||
return Path.Combine(Application.persistentDataPath, "mail_state.json");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user