Ejemplo n.º 1
0
        void Reset()
        {
            portraitOrDefaultAdaptation = new BlendedClipsAdaptor(GenDefaultCurve());
            landscapeAdaptation         = new BlendedClipsAdaptor(GenDefaultCurve());

            AnimationCurve GenDefaultCurve() =>
            new AnimationCurve(new Keyframe[]
            {
                new Keyframe(4f / 3f, 0, 1.2f, 1.2f),                                               // iPad
                new Keyframe(16f / 9f, Mathf.InverseLerp(4 / 3f, 19.5f / 9f, 16 / 9f), 1.2f, 1.2f), // A 16:9 breakpoint
                new Keyframe(19.5f / 9f, 1, 1.2f, 1.2f),                                            // I think LG G7 is the longest phone in the world now?
            });
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Make the adaptation curve reset to the specified <paramref name="curve">.
 /// </summary>
 private protected void ResetAdaptationToCurve(AnimationCurve curve)
 {
     portraitOrDefaultAdaptation = new BlendedClipsAdaptor(curve);
     landscapeAdaptation         = new BlendedClipsAdaptor(curve);
 }
Ejemplo n.º 3
0
        internal bool IsAdaptable(bool forPortrait)
        {
            BlendedClipsAdaptor bca = forPortrait ? portraitOrDefaultAdaptation : landscapeAdaptation;

            return(bca.Adaptable);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Check if both clips are nested on the same controller asset or not.
        /// </summary>
        internal bool TryGetLinkedControllerAsset(bool forPortrait, out RuntimeAnimatorController controllerAsset)
        {
            BlendedClipsAdaptor bca = forPortrait ? portraitOrDefaultAdaptation : landscapeAdaptation;

            return(bca.TryGetLinkedControllerAsset(out controllerAsset));
        }
Ejemplo n.º 5
0
#pragma warning restore 0649

#if UNITY_EDITOR
        internal void AssignAdaptationClips(AnimationClip normalState, AnimationClip adaptedState, bool forPortrait)
        {
            BlendedClipsAdaptor bca = forPortrait ? portraitOrDefaultAdaptation : landscapeAdaptation;

            bca.AssignAdaptationClips(normalState, adaptedState);
        }
Ejemplo n.º 6
0
 void Reset()
 {
     portraitOrDefaultAdaptation = new BlendedClipsAdaptor(AnimationCurve.Linear(0, 0, iPhoneXNotchHeightRelative, 1));
     landscapeAdaptation         = new BlendedClipsAdaptor(AnimationCurve.Linear(0, 0, iPhoneXNotchHeightRelative, 1));
 }