Skip to content

Instantly share code, notes, and snippets.

@SiarheiPilat
Last active February 27, 2024 19:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiarheiPilat/e4d62fb994f46180703f3fc0e6978fd7 to your computer and use it in GitHub Desktop.
Save SiarheiPilat/e4d62fb994f46180703f3fc0e6978fd7 to your computer and use it in GitHub Desktop.
Get all currently open editor windows in Unity.
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