GetFirstAnimationClipFromMotion() private static method

private static GetFirstAnimationClipFromMotion ( Motion motion ) : AnimationClip
motion UnityEngine.Motion
return UnityEngine.AnimationClip
Esempio n. 1
0
        public static ModelImporterAnimationType GetAnimationType(Motion motion)
        {
            AnimationClip firstAnimationClipFromMotion = AvatarPreview.GetFirstAnimationClipFromMotion(motion);
            ModelImporterAnimationType result;

            if (firstAnimationClipFromMotion)
            {
                if (firstAnimationClipFromMotion.legacy)
                {
                    result = ModelImporterAnimationType.Legacy;
                }
                else if (firstAnimationClipFromMotion.humanMotion)
                {
                    result = ModelImporterAnimationType.Human;
                }
                else
                {
                    result = ModelImporterAnimationType.Generic;
                }
            }
            else
            {
                result = ModelImporterAnimationType.None;
            }
            return(result);
        }
Esempio n. 2
0
        private static GameObject CalculatePreviewGameObject(Animator selectedAnimator, Motion motion, ModelImporterAnimationType animationType)
        {
            AnimationClip firstAnimationClipFromMotion = AvatarPreview.GetFirstAnimationClipFromMotion(motion);
            GameObject    gameObject = AvatarPreviewSelection.GetPreview(animationType);

            if (AvatarPreview.IsValidPreviewGameObject(gameObject, ModelImporterAnimationType.None))
            {
                return(gameObject);
            }
            if (selectedAnimator != null && AvatarPreview.IsValidPreviewGameObject(selectedAnimator.gameObject, animationType))
            {
                return(selectedAnimator.gameObject);
            }
            gameObject = AvatarPreview.FindBestFittingRenderableGameObjectFromModelAsset(firstAnimationClipFromMotion, animationType);
            if (gameObject != null)
            {
                return(gameObject);
            }
            if (animationType == ModelImporterAnimationType.Human)
            {
                return(AvatarPreview.GetHumanoidFallback());
            }
            if (animationType == ModelImporterAnimationType.Generic)
            {
                return(AvatarPreview.GetGenericAnimationFallback());
            }
            return(null);
        }
Esempio n. 3
0
        public static ModelImporterAnimationType GetAnimationType(Motion motion)
        {
            AnimationClip animationClipFromMotion = AvatarPreview.GetFirstAnimationClipFromMotion(motion);

            if (!(bool)((Object)animationClipFromMotion))
            {
                return(ModelImporterAnimationType.None);
            }
            if (animationClipFromMotion.legacy)
            {
                return(ModelImporterAnimationType.Legacy);
            }
            return(animationClipFromMotion.humanMotion ? ModelImporterAnimationType.Human : ModelImporterAnimationType.Generic);
        }
Esempio n. 4
0
        public static ModelImporterAnimationType GetAnimationType(Motion motion)
        {
            AnimationClip firstAnimationClipFromMotion = AvatarPreview.GetFirstAnimationClipFromMotion(motion);

            if (!firstAnimationClipFromMotion)
            {
                return(ModelImporterAnimationType.None);
            }
            if (firstAnimationClipFromMotion.legacy)
            {
                return(ModelImporterAnimationType.Legacy);
            }
            if (firstAnimationClipFromMotion.humanMotion)
            {
                return(ModelImporterAnimationType.Human);
            }
            return(ModelImporterAnimationType.Generic);
        }