コガネブログ

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

【Unity】Unity Test Runner のウィンドウをスクリプトから開く方法

概要

using System.Reflection;
using UnityEditor;

internal static class Example
{
    [MenuItem( "Tools/Example" )]
    private static void Hoge()
    {
        var assembly = Assembly.Load( "UnityEditor.TestRunner" );
        var type     = assembly.GetType( "UnityEditor.TestTools.TestRunner.TestRunnerWindow" );

        EditorWindow.GetWindow( type );
    }
}