mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
!B(Node Editor Widnow) Switch graph still old graph
This commit is contained in:
parent
d705c8bdd1
commit
8da6d7fb93
@ -240,8 +240,8 @@ namespace XNodeEditor {
|
|||||||
public static NodeEditorWindow Open(XNode.NodeGraph graph) {
|
public static NodeEditorWindow Open(XNode.NodeGraph graph) {
|
||||||
if (!graph) return null;
|
if (!graph) return null;
|
||||||
|
|
||||||
var windows = Resources.FindObjectsOfTypeAll<NodeEditorWindow>();
|
var windows = Resources.FindObjectsOfTypeAll<NodeEditorWindow>();
|
||||||
NodeEditorWindow w = null;
|
NodeEditorWindow w = null;
|
||||||
foreach (var window in windows)
|
foreach (var window in windows)
|
||||||
{
|
{
|
||||||
if (window.Lock)
|
if (window.Lock)
|
||||||
@ -249,36 +249,33 @@ namespace XNodeEditor {
|
|||||||
if (window.graph == graph)
|
if (window.graph == graph)
|
||||||
{
|
{
|
||||||
w = window;
|
w = window;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
w = window;
|
w = window;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!w)
|
if (!w)
|
||||||
{
|
{
|
||||||
w = EditorWindow.CreateInstance<NodeEditorWindow>();
|
w = CreateInstance<NodeEditorWindow>();
|
||||||
w.titleContent = new GUIContent("xNode");
|
w.titleContent = new GUIContent("xNode");
|
||||||
|
Debug.LogError("创建");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NodeGraphEditor graphEditor = NodeGraphEditor.GetEditor(graph, w);
|
||||||
|
w.graphEditor = graphEditor;
|
||||||
|
w.wantsMouseMove = true;
|
||||||
|
w.graph = graph;
|
||||||
|
|
||||||
w.Show(true);
|
w.Show(true);
|
||||||
w.Focus();
|
w.Focus();
|
||||||
|
|
||||||
if (w.graphEditor == null)
|
current = w;
|
||||||
{
|
|
||||||
NodeGraphEditor graphEditor = NodeGraphEditor.GetEditor(graph, w);
|
|
||||||
w.graphEditor = graphEditor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//refresh target
|
|
||||||
w.graphEditor.target = graph;
|
|
||||||
}
|
|
||||||
|
|
||||||
w.wantsMouseMove = true;
|
|
||||||
w.graph = graph;
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user