private void SelectClip(int selected)
 {
   if (EditorGUI.s_DelayedTextEditor != null && Event.current != null)
     EditorGUI.s_DelayedTextEditor.EndGUI(Event.current.type);
   this.DestroyEditorsAndData();
   this.selectedClipIndex = selected;
   if (this.selectedClipIndex < 0 || this.selectedClipIndex >= this.m_ClipAnimations.arraySize)
   {
     this.selectedClipIndex = -1;
   }
   else
   {
     AnimationClipInfoProperties animationClipInfoAtIndex = this.GetAnimationClipInfoAtIndex(selected);
     AnimationClip animationClipForTake = this.singleImporter.GetPreviewAnimationClipForTake(animationClipInfoAtIndex.takeName);
     if (!((UnityEngine.Object) animationClipForTake != (UnityEngine.Object) null))
       return;
     this.m_AnimationClipEditor = (AnimationClipEditor) Editor.CreateEditor((UnityEngine.Object) animationClipForTake);
     this.InitMask(animationClipInfoAtIndex);
     this.SyncClipEditor();
   }
 }
 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();
         }
     }
 }
 private void DestroyEditorsAndData()
 {
   if ((UnityEngine.Object) this.m_AnimationClipEditor != (UnityEngine.Object) null)
   {
     UnityEngine.Object.DestroyImmediate((UnityEngine.Object) this.m_AnimationClipEditor);
     this.m_AnimationClipEditor = (AnimationClipEditor) null;
   }
   if ((bool) ((UnityEngine.Object) this.m_MaskInspector))
   {
     UnityEngine.Object.DestroyImmediate((UnityEngine.Object) this.m_MaskInspector);
     this.m_MaskInspector = (AvatarMaskInspector) null;
   }
   if (!(bool) ((UnityEngine.Object) this.m_Mask))
     return;
   UnityEngine.Object.DestroyImmediate((UnityEngine.Object) this.m_Mask);
   this.m_Mask = (AvatarMask) null;
 }