Created
April 30, 2022 05:14
-
-
Save SiarheiPilat/d2e1ff0cde00f5d7393a3f6a046007b6 to your computer and use it in GitHub Desktop.
This file contains 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
// taken from https://forum.unity.com/threads/shortcut-to-close-editor-window-close-tab.1232121/ | |
using UnityEditor; | |
using UnityEngine; | |
public class EditorCloseWindowTab : Editor | |
{ | |
[MenuItem("Shortcuts/Close Window Tab")] | |
static void CloseTab() | |
{ | |
EditorWindow focusedWindow = EditorWindow.focusedWindow; | |
if (focusedWindow != null) | |
{ | |
CloseTab(focusedWindow); | |
} | |
else | |
{ | |
Debug.LogWarning("Found no focused window to close"); | |
} | |
} | |
static void CloseTab(EditorWindow editorWindow) | |
{ | |
editorWindow.Close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment