コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Preferences ウィンドウを開くエディタ拡張

ソースコード

using System.Reflection;
using UnityEditor;

public static class Hoge
{
    [MenuItem( "Hoge/Fuga" )]
    public static void Fuga()
    {
         var asm = Assembly.GetAssembly( typeof( EditorWindow ) );
         var type = asm.GetType( "UnityEditor.PreferencesWindow" );
         var method = type.GetMethod( "ShowPreferencesWindow", BindingFlags.NonPublic | BindingFlags.Static );
         method.Invoke( null, null );
    }
}

参考サイト様