Can Open Multiple Graphs
This commit is contained in:
parent
05600f7bc1
commit
e60d3604c0
@ -14,23 +14,25 @@ namespace ImageProcessingGraph.Editor.Windows
|
||||
|
||||
public static void Open(ImageProcessingGraphAsset asset)
|
||||
{
|
||||
ImageProcessingGraphEditorWindow[] windows = Resources.FindObjectsOfTypeAll<ImageProcessingGraphEditorWindow>();
|
||||
|
||||
foreach (var w in windows)
|
||||
var existingWindows = Resources.FindObjectsOfTypeAll<ImageProcessingGraphEditorWindow>();
|
||||
foreach (var w in existingWindows)
|
||||
{
|
||||
w.Focus();
|
||||
return;
|
||||
if (w.CurrentGraph == asset)
|
||||
{
|
||||
w.Focus(); // 👁 focus the OG window
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ImageProcessingGraphEditorWindow window =
|
||||
CreateWindow<ImageProcessingGraphEditorWindow>(typeof(ImageProcessingGraphEditorWindow),
|
||||
typeof(SceneView));
|
||||
|
||||
window.titleContent = new GUIContent($"{asset.name}", EditorGUIUtility.ObjectContent(null, typeof(ImageProcessingGraphAsset)).image
|
||||
);
|
||||
var window = CreateWindow<ImageProcessingGraphEditorWindow>(typeof(SceneView));
|
||||
window.titleContent = new GUIContent($"{asset.name}",
|
||||
EditorGUIUtility.ObjectContent(null, typeof(ImageProcessingGraphAsset)).image);
|
||||
window.Load(asset);
|
||||
window.Focus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if(currentGraph != null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user