打包封装EXE文件后,运行EXE文件后,是可以正常的存储数据,读取数据。
第一次打开EXE文件
再次打开EXE文件
接着相关资料3的代码JSONDemon.cs的DataJSONFile()函数的代码
/// <summary>
/// 判断 保存的JSON 格式的空文本文件 是否存在,如果存在 就 复制粘贴 为新的存档文件。
/// </summary>
private void DataJSONFile(string path)// [Unity][File][JSON]file.copy的使用方法代码动态创建.json文件
{
if (File.Exists(Application.streamingAssetsPath + "/empty.json") == true
&& File.Exists(path) == false)//Application.dataPath + path_json
{
File.Copy(Application.streamingAssetsPath + "/empty.json", path);
//Directory.CreateDirectory(path);