public void Save() { if (string.IsNullOrEmpty(CurrentPath)) { throw new ArgumentException("Cannot save. Path is unknown"); } IoUtilities.SaveToFile(CurrentPath, _graph); }
private void OpenGraph() { var path = GraphsDefaultPath; path = EditorUtility.OpenFilePanel("Open Graph", Directory.GetParent(path).FullName, "bytes"); if (string.IsNullOrEmpty(path)) { return; } if (!File.Exists(path)) { EditorUtility.DisplayDialog("File not exists", "Selected file not exists, you must select Graph binary file.", "Ok"); return; } var graph = IoUtilities.LoadFromFile <Graph>(path, Graph.Signature); AddGraphContext(new GraphContext(graph) { Name = Path.GetFileNameWithoutExtension(path), CurrentPath = path, }); }