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() {
|
||||
wantsMouseMove = true;
|
||||
|
||||
Event e = Event.current;
|
||||
switch (e.type) {
|
||||
case EventType.MouseMove:
|
||||
@ -57,10 +56,12 @@ namespace XNodeEditor {
|
||||
}
|
||||
break;
|
||||
case EventType.KeyDown:
|
||||
if (e.keyCode == KeyCode.F) Home();
|
||||
if (GUIUtility.keyboardControl == 0) break;
|
||||
else if (e.keyCode == KeyCode.F) Home();
|
||||
break;
|
||||
case EventType.MouseDown:
|
||||
Repaint();
|
||||
if (e.button == 0) {
|
||||
SelectNode(hoveredNode);
|
||||
if (IsHoveringPort) {
|
||||
if (hoveredPort.IsOutput) {
|
||||
@ -80,6 +81,7 @@ namespace XNodeEditor {
|
||||
draggedNode = hoveredNode;
|
||||
dragOffset = hoveredNode.position - WindowToGridPosition(e.mousePosition);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EventType.MouseUp:
|
||||
if (e.button == 0) {
|
||||
@ -97,14 +99,17 @@ namespace XNodeEditor {
|
||||
draggedOutputTarget = null;
|
||||
EditorUtility.SetDirty(graph);
|
||||
Repaint();
|
||||
AssetDatabase.SaveAssets();
|
||||
} else if (IsDraggingNode) {
|
||||
draggedNode = null;
|
||||
AssetDatabase.SaveAssets();
|
||||
} else if (GUIUtility.hotControl != 0) {
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
} else if (e.button == 1) {
|
||||
if (!isPanning) ShowContextMenu();
|
||||
isPanning = false;
|
||||
}
|
||||
AssetDatabase.SaveAssets();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user