Skip to content

Instantly share code, notes, and snippets.

@kraj0t
Last active March 3, 2024 17:21
Show Gist options
  • Save kraj0t/de167c88ff9fc0abea70d3a3d87d4027 to your computer and use it in GitHub Desktop.
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)
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