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(); }
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(); }