Last active
March 3, 2024 17:21
-
-
Save kraj0t/de167c88ff9fc0abea70d3a3d87d4027 to your computer and use it in GitHub Desktop.
[Unity] Editor shortcut for closing the window/tab that is currently focused (I just cannot live without it heheh)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEditor.ShortcutManagement; | |
using UnityEngine; | |
public class CloseEditorWindowShortcut | |
{ | |
[Shortcut("Window/Close", KeyCode.W, ShortcutModifiers.Control)] | |
private static void CloseTab(ShortcutArguments args) | |
{ | |
if (EditorWindow.focusedWindow != null) | |
{ | |
EditorWindow.focusedWindow.Close(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment