mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 17:56:06 +08:00
Improved editor responsiveness
No longer saves asset on right click drag
This commit is contained in:
parent
8bb30e2f87
commit
455bb723d2
@ -27,7 +27,6 @@ namespace XNodeEditor {
|
|||||||
|
|
||||||
public void Controls() {
|
public void Controls() {
|
||||||
wantsMouseMove = true;
|
wantsMouseMove = true;
|
||||||
|
|
||||||
Event e = Event.current;
|
Event e = Event.current;
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case EventType.MouseMove:
|
case EventType.MouseMove:
|
||||||
@ -57,10 +56,12 @@ namespace XNodeEditor {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EventType.KeyDown:
|
case EventType.KeyDown:
|
||||||
if (e.keyCode == KeyCode.F) Home();
|
if (GUIUtility.keyboardControl == 0) break;
|
||||||
|
else if (e.keyCode == KeyCode.F) Home();
|
||||||
break;
|
break;
|
||||||
case EventType.MouseDown:
|
case EventType.MouseDown:
|
||||||
Repaint();
|
Repaint();
|
||||||
|
if (e.button == 0) {
|
||||||
SelectNode(hoveredNode);
|
SelectNode(hoveredNode);
|
||||||
if (IsHoveringPort) {
|
if (IsHoveringPort) {
|
||||||
if (hoveredPort.IsOutput) {
|
if (hoveredPort.IsOutput) {
|
||||||
@ -80,6 +81,7 @@ namespace XNodeEditor {
|
|||||||
draggedNode = hoveredNode;
|
draggedNode = hoveredNode;
|
||||||
dragOffset = hoveredNode.position - WindowToGridPosition(e.mousePosition);
|
dragOffset = hoveredNode.position - WindowToGridPosition(e.mousePosition);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case EventType.MouseUp:
|
case EventType.MouseUp:
|
||||||
if (e.button == 0) {
|
if (e.button == 0) {
|
||||||
@ -97,14 +99,17 @@ namespace XNodeEditor {
|
|||||||
draggedOutputTarget = null;
|
draggedOutputTarget = null;
|
||||||
EditorUtility.SetDirty(graph);
|
EditorUtility.SetDirty(graph);
|
||||||
Repaint();
|
Repaint();
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
} else if (IsDraggingNode) {
|
} else if (IsDraggingNode) {
|
||||||
draggedNode = null;
|
draggedNode = null;
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
} else if (GUIUtility.hotControl != 0) {
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
}
|
}
|
||||||
} else if (e.button == 1) {
|
} else if (e.button == 1) {
|
||||||
if (!isPanning) ShowContextMenu();
|
if (!isPanning) ShowContextMenu();
|
||||||
isPanning = false;
|
isPanning = false;
|
||||||
}
|
}
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user