LoginSignup
0
0

More than 5 years have passed since last update.

【UnityEditor】現在開いている全てのEditorWindowを取得する方法

Last updated at Posted at 2018-07-11

はじめに

EditorWindowを一括取得する方法を忘れてしまったので備忘録として記事にしてみました。

解説

Resources.FindObjectsOfTypeAll()を使うと現在開いている全てのEditorWindowを取得できます。

EditorWindow.FindObjectsOfType()だとなぜか取得できません

ソースコード

Hoge.cs
using UnityEngine;
using UnityEditor;

public static class Hoge
{
    [MenuItem("Hoge/Show EditorWindow All")]
    static void ShowEditorWindowAll()
    {
        foreach (var window in Resources.FindObjectsOfTypeAll<EditorWindow>())
        {
            Debug.Log("Exist: " + window.GetType());
        }
    }
}

環境

Unity2018.2.0f2

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0