예제 #1
0
 private void OpenGraph(Graph graph, bool closeCurrentlyOpenedGraph, bool clearGraphTabs, bool centerAllNodesInWindow, bool recordUndo = true)
 {
     if (graph == null)
     {
         return;
     }
     if (CurrentGraph == graph)
     {
         return;
     }
     if (closeCurrentlyOpenedGraph)
     {
         CloseCurrentGraph(clearGraphTabs);
     }
     if (recordUndo)
     {
         RecordUndo("Open Graph");
     }
     WindowSettings.AddGraphToRecentlyOpenedGraphs(graph);
     CurrentGraph = graph;
     GraphUtils.CheckAndCreateAnyMissingSystemNodes(graph);
     ConstructGraphGUI();
     if (centerAllNodesInWindow)
     {
         CenterAllNodesInWindow();
     }
     //            Undo.IncrementCurrentGroup();
     //            Undo.SetCurrentGroupName(m_graphAssetName);
     SetView(View.Graph);
     Repaint();
     GraphEvent.Send(GraphEvent.EventType.EVENT_GRAPH_OPENED);
     m_graphAssetPath = AssetDatabase.GetAssetPath(CurrentGraph);
 }