Last active
February 27, 2024 19:46
-
-
Save SiarheiPilat/e4d62fb994f46180703f3fc0e6978fd7 to your computer and use it in GitHub Desktop.
Get all currently open editor windows in Unity.
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
using UnityEngine; | |
using UnityEditor; | |
public class InternalEditorWindowsTracker : MonoBehaviour | |
{ | |
/// <summary> | |
/// Get all currently open editor windows including default Unity windows, custom editors and windows that are tabbed. | |
/// Found here: https://answers.unity.com/questions/1237463/how-do-i-get-a-reference-to-the-default-editor-win.html?_ga=2.133529742.1822843399.1574452927-44739247.1572947128 | |
/// </summary> | |
public static EditorWindow[] GetAllOpenEditorWindows() | |
{ | |
return Resources.FindObjectsOfTypeAll<EditorWindow>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment