GetAnimationClipsFlattened() приватный Метод

private GetAnimationClipsFlattened ( ) : UnityEngine.AnimationClip[]
Результат UnityEngine.AnimationClip[]
Пример #1
0
        private static AnimationClip GetFirstAnimationClipFromMotion(Motion motion)
        {
            AnimationClip animationClip = motion as AnimationClip;
            AnimationClip result;

            if (animationClip)
            {
                result = animationClip;
            }
            else
            {
                UnityEditor.Animations.BlendTree blendTree = motion as UnityEditor.Animations.BlendTree;
                if (blendTree)
                {
                    AnimationClip[] animationClipsFlattened = blendTree.GetAnimationClipsFlattened();
                    if (animationClipsFlattened.Length > 0)
                    {
                        result = animationClipsFlattened[0];
                        return(result);
                    }
                }
                result = null;
            }
            return(result);
        }
Пример #2
0
        private static AnimationClip GetFirstAnimationClipFromMotion(Motion motion)
        {
            AnimationClip clip = motion as AnimationClip;

            if (clip != null)
            {
                return(clip);
            }
            UnityEditor.Animations.BlendTree tree = motion as UnityEditor.Animations.BlendTree;
            if (tree != null)
            {
                AnimationClip[] animationClipsFlattened = tree.GetAnimationClipsFlattened();
                if (animationClipsFlattened.Length > 0)
                {
                    return(animationClipsFlattened[0]);
                }
            }
            return(null);
        }
Пример #3
0
        static AnimationClip GetFirstAnimationClipFromMotion(Motion motion)
        {
            AnimationClip clip = motion as AnimationClip;

            if (clip)
            {
                return(clip);
            }

            Animations.BlendTree blendTree = motion as Animations.BlendTree;
            if (blendTree)
            {
                AnimationClip[] clips = blendTree.GetAnimationClipsFlattened();
                if (clips.Length > 0)
                {
                    return(clips[0]);
                }
            }

            return(null);
        }