瀏覽代碼

Merge pull request #57964 from mbrlabs/deselect

Deselect nodes in the 3D editor when pressing ESC
JFonS 3 年之前
父節點
當前提交
8317753c24
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      editor/plugins/node_3d_editor_plugin.cpp

+ 6 - 1
editor/plugins/node_3d_editor_plugin.cpp

@@ -1889,7 +1889,12 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
 			}
 		}
 
-		if (_edit.mode != TRANSFORM_NONE) {
+		if (_edit.mode == TRANSFORM_NONE) {
+			if (k->get_keycode() == Key::ESCAPE && !cursor.region_select) {
+				_clear_selected();
+				return;
+			}
+		} else {
 			// We're actively transforming, handle keys specially
 			TransformPlane new_plane = TRANSFORM_VIEW;
 			String new_message;