public static void SelectAnimationClip(AnimationClip clip)
        {
            if (AnimationWindow == null || clip == null)
            {
                return;
            }
            AnimationClip[] animationClips = AnimationUtility.GetAnimationClips(Selection.activeGameObject);
            int             index          = 0;

            while (index < animationClips.Length)
            {
                if (animationClips[index] == clip)
                {
                    break;
                }

                index++;
            }
            if (index == animationClips.Length)
            {
                Debug.LogError("Couldn't find clip " + clip.name);
            }
            else
            {
                ActiveAnimationClipProperty.SetValue(GetState(), clip, null);
            }
            AnimationWindow.Repaint();
        }
 public static void SetCurrentFrame(int frame, float time)
 {
     if (AnimationWindow == null)
     {
         return;
     }
     CurrentTimeField.SetValue(GetState(), time);
     AnimationWindow.Repaint();
 }