Prettify() public static method

public static Prettify ( string sourceJson ) : string
sourceJson string
return string
        public void Save()
        {
            var dir = SaveDataDirectoryPath;

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            m_lastModified = DateTime.UtcNow;

            var dataStr    = Json.Serialize(ToJsonDictionary());
            var prettified = Json.Prettify(dataStr);

            using (var sw = new StreamWriter(SaveDataPath)) {
                sw.Write(prettified);
            }
            // reflect change of data.
            AssetDatabase.Refresh();
        }
示例#2
0
        public void ExportToJson()
        {
            LogUtility.Logger.Log("[SaveData] Saved to Disk.");

            var dir = SaveDataDirectoryPath;

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            m_version = ABG_FILE_VERSION;

            var dataStr    = Json.Serialize(ToJsonDictionary());
            var prettified = Json.Prettify(dataStr);

            using (var sw = new StreamWriter(SaveDataJsonPath)) {
                sw.Write(prettified);
            }
            // reflect change of data.
            AssetDatabase.Refresh();
        }