Skip to content

Instantly share code, notes, and snippets.

@GhatSmith
Created November 27, 2018 17:28
Show Gist options
  • Save GhatSmith/1c0720e53d0002accff55432568c7add to your computer and use it in GitHub Desktop.
Save GhatSmith/1c0720e53d0002accff55432568c7add to your computer and use it in GitHub Desktop.
Little script to open an additional Animator window in Unity
using UnityEditor;
using UnityEngine;
namespace Framework.Core.EditorExtension
{
public class OpenAdditionalAnimatorWindow : MonoBehaviour
{
static EditorWindow window = null;
[MenuItem("Tools/Animations/Open Additional Animator Window &%a", false)]
static void CreateAdditionalAnimatorWindow()
{
if (window == null)
{
// Open additional animator window
window = (ScriptableObject.CreateInstance(GetAnimatorWindowType()) as EditorWindow);
window.Show();
}
else
{
// Close additional animator window
window.Close();
DestroyImmediate(window);
window = null;
}
}
private static System.Type GetAnimatorWindowType()
{
return (typeof(UnityEditor.Graphs.AnimationCurveTypeConverter).Assembly.GetType("UnityEditor.Graphs.AnimatorControllerTool"));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment