コード例 #1
0
ファイル: SaveIO.cs プロジェクト: GreenTea-M/ProjectPengi
        private string LoadJsonString(JsonExecutor jsonExecutor)
        {
            var path = GetPath(jsonExecutor);

            if (File.Exists(path))
            {
                jsonExecutor.UsingJsonData(File.ReadAllText(path));
                return(jsonExecutor.GetJsonString());
            }

            Debug.LogError("Save file not found in path: " + path);
            return(null);
        }
コード例 #2
0
ファイル: SaveIO.cs プロジェクト: GreenTea-M/ProjectPengi
        private bool OverwriteJson(JsonExecutor jsonExecutor)
        {
            if (jsonExecutor.GetFilename() == null)
            {
                return(false);
            }

            string path = GetPath(jsonExecutor);

            File.WriteAllText(path, jsonExecutor.GetJsonString());

#if UNITY_WEBGL
            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                SyncFiles();
            }
#endif

            return(true);
        }