public override void OnInteractivePreviewGUI(Rect r, GUIStyle background)
{
if (selState != null)
{
if (motion == null || (motion != null && motion.name != selState.GetMotion().name))
{
gameObjectEditor = null;
motion = selState.GetMotion() as AnimationClip;
}
if (gameObjectEditor == null)
{
motion = selState.GetMotion() as AnimationClip;
gameObjectEditor = Editor.CreateEditor(motion);
}
if (gameObjectEditor.HasPreviewGUI())
{
gameObjectEditor.OnInteractivePreviewGUI(r, background);
}
}
}