Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
Arquivo: Graph.cs Projeto: senchov/ECS
        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);
        }
Exemplo n.º 3
0
 public void saveToFile(string fileName, JSONClass data)
 {
     // save to file already creates directories and the file!
     data.SaveToFile(getFullFilePath(fileName));
 }