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? }); }
/// <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); }
internal bool IsAdaptable(bool forPortrait) { BlendedClipsAdaptor bca = forPortrait ? portraitOrDefaultAdaptation : landscapeAdaptation; return(bca.Adaptable); }
/// <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)); }
#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); }
void Reset() { portraitOrDefaultAdaptation = new BlendedClipsAdaptor(AnimationCurve.Linear(0, 0, iPhoneXNotchHeightRelative, 1)); landscapeAdaptation = new BlendedClipsAdaptor(AnimationCurve.Linear(0, 0, iPhoneXNotchHeightRelative, 1)); }