private void SelectClip(int selected)
{
if ((EditorGUI.s_DelayedTextEditor != null) && (Event.current != null))
{
EditorGUI.s_DelayedTextEditor.EndGUI(Event.current.type);
}
UnityEngine.Object.DestroyImmediate(this.m_AnimationClipEditor);
this.m_AnimationClipEditor = null;
this.selectedClipIndex = selected;
if ((this.selectedClipIndex < 0) || (this.selectedClipIndex >= this.m_ClipAnimations.arraySize))
{
this.selectedClipIndex = -1;
}
else
{
AnimationClipInfoProperties animationClipInfoAtIndex = this.GetAnimationClipInfoAtIndex(selected);
AnimationClip previewAnimationClipForTake = this.singleImporter.GetPreviewAnimationClipForTake(animationClipInfoAtIndex.takeName);
if (previewAnimationClipForTake != null)
{
this.m_AnimationClipEditor = (AnimationClipEditor) Editor.CreateEditor(previewAnimationClipForTake);
this.SyncClipEditor();
}
}
}