ソースコード
using System; using UnityEditor; using UnityEngine; public sealed class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var windows = Resources.FindObjectsOfTypeAll<EditorWindow>(); var inspectorWindow = Array.Find( windows, x => x.GetType().Name == "InspectorWindow" ); if ( inspectorWindow == null ) return; inspectorWindow.maximized = !inspectorWindow.maximized; } }