summaryrefslogtreecommitdiffstats
path: root/Scripts/Fold/Editor/FoldWindow.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/Fold/Editor/FoldWindow.cs')
-rw-r--r--Scripts/Fold/Editor/FoldWindow.cs32
1 files changed, 10 insertions, 22 deletions
diff --git a/Scripts/Fold/Editor/FoldWindow.cs b/Scripts/Fold/Editor/FoldWindow.cs
index 69d7066..270bc2a 100644
--- a/Scripts/Fold/Editor/FoldWindow.cs
+++ b/Scripts/Fold/Editor/FoldWindow.cs
@@ -4,41 +4,29 @@ using GraphProcessor;
public class FoldWindow : BaseGraphWindow
{
- const string DefaultGraphPath = "Assets/FoldGraph.asset";
+ const string GraphPath = "Assets/FoldGraph.asset";
[MenuItem("Tools/yum_food/Fold")]
- public static BaseGraphWindow Open()
+ public static void Open()
{
- var graphWindow = GetWindow<FoldWindow>();
-
- var graph = AssetDatabase.LoadAssetAtPath<FoldGraph>(DefaultGraphPath);
+ var graph = AssetDatabase.LoadAssetAtPath<FoldGraph>(GraphPath);
if (graph == null)
{
graph = ScriptableObject.CreateInstance<FoldGraph>();
- AssetDatabase.CreateAsset(graph, DefaultGraphPath);
+ AssetDatabase.CreateAsset(graph, GraphPath);
AssetDatabase.SaveAssets();
}
- graphWindow.InitializeGraph(graph);
-
- graphWindow.Show();
- return graphWindow;
+ var w = GetWindow<FoldWindow>();
+ w.InitializeGraph(graph);
+ w.Show();
}
- protected override void OnDestroy()
- {
- graphView?.Dispose();
- }
+ protected override void OnDestroy() => graphView?.Dispose();
protected override void InitializeWindow(BaseGraph graph)
{
titleContent = new GUIContent("Fold");
-
- // Create the graph view with our custom view
- if (graphView == null)
- graphView = new FoldGraphView(this);
-
- rootView.Add(graphView);
+ if (graphView == null) rootView.Add(graphView = new FoldGraphView(this));
}
-}
-
+} \ No newline at end of file