private static GameObject CalculatePreviewGameObject(UnityEngine.Animator selectedAnimator, Motion motion, ModelImporterAnimationType animationType)
{
AnimationClip firstAnimationClipFromMotion = GetFirstAnimationClipFromMotion(motion);
GameObject preview = AvatarPreviewSelection.GetPreview(animationType);
if (IsValidPreviewGameObject(preview, ModelImporterAnimationType.None))
{
return preview;
}
if ((selectedAnimator != null) && IsValidPreviewGameObject(selectedAnimator.gameObject, animationType))
{
return selectedAnimator.gameObject;
}
preview = FindBestFittingRenderableGameObjectFromModelAsset(firstAnimationClipFromMotion, animationType);
if (preview != null)
{
return preview;
}
if (animationType == ModelImporterAnimationType.Human)
{
return GetHumanoidFallback();
}
if (animationType == ModelImporterAnimationType.Generic)
{
return GetGenericAnimationFallback();
}
return null;
}