public void SaveStatusData(string scene) { status["atScene"] = scene; JSONArray a = new JSONArray(); foreach (var h in messageManager.historyDataList) { var node = h.ToJSONNode(); a.Add(node); } JSONClass saveData = new JSONClass(); saveData["status"] = status; saveData["history"] = a; saveData.SaveToFile(status_savePath); //status.SaveToFile(status_savePath); }
public void SaveToFile(string path) { JSONClass graphJson = new JSONClass(); graphJson["nodes"] = new JSONArray(); foreach (N node in Nodes) { graphJson["nodes"].Add(JsonUtility.ToJson(node)); } graphJson["edges"] = new JSONArray(); foreach (var edgeList in Edges) { foreach (GraphEdge edge in edgeList.Value) { graphJson["edges"].Add(JsonUtility.ToJson(edge)); } } graphJson.SaveToFile(path); }
public void saveToFile(string fileName, JSONClass data) { // save to file already creates directories and the file! data.SaveToFile(getFullFilePath(fileName)); }