ソースコード
using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.Playables;
[CustomEditor( typeof( PlayableDirector ) )]
public sealed class PlayableDirectorInspector : Editor
{
private static readonly Type BASE_EDITOR_TYPE = typeof( Editor )
.Assembly
.GetType( "UnityEditor.DirectorEditor" );
public override void OnInspectorGUI()
{
var playableDirector = ( PlayableDirector ) target;
using ( new EditorGUILayout.HorizontalScope() )
{
if ( GUILayout.Button( "Open Timeline Window" ) )
{
EditorApplication.ExecuteMenuItem( "Window/Sequencing/Timeline" );
}
}
var editor = CreateEditor( playableDirector, BASE_EDITOR_TYPE );
editor.OnInspectorGUI();
}
}
使用例