Ejemplo n.º 1
0
    /// <summary> Save the current app state as a project </summary>
    public static void Save()
    {
        Project prj = new Project();

        prj.data          = DataStorage.Create();
        prj.graphSettings = GraphStorage.Create();

        string path = StandaloneFileBrowser.SaveFilePanel("Save your project", "", "", FileExtension);

        if (path == "")
        {
            return;
        }

        string jsonString = JsonUtility.ToJson(prj);

        try
        {
            File.WriteAllText(path, jsonString);
        }
        catch (Exception e)
        {
            string msg = "Error saving project to file " + path + "\n\n" + e.Message;
            UIManager.I.ShowMessageDialog(msg);
            return;
        }
        UIManager.I.ShowMessageDialog("Project Saved");
    }