From 49b1f9a5c2b86a3839f2e4dcea1976a85dd75480 Mon Sep 17 00:00:00 2001 From: Braedon Date: Fri, 4 Feb 2022 17:54:38 -0500 Subject: [PATCH] Instant camera easing --- Assets/Scripts/Util/EasingFunctions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/Scripts/Util/EasingFunctions.cs b/Assets/Scripts/Util/EasingFunctions.cs index 980251d6..85206315 100644 --- a/Assets/Scripts/Util/EasingFunctions.cs +++ b/Assets/Scripts/Util/EasingFunctions.cs @@ -64,6 +64,7 @@ namespace RhythmHeavenMania.Util public enum Ease { Linear = 0, + Instant, EaseInQuad, EaseOutQuad, EaseInOutQuad, @@ -108,6 +109,11 @@ namespace RhythmHeavenMania.Util return Mathf.Lerp(start, end, value); } + public static float Instant(float start, float end, float value) + { + return Mathf.Lerp(end, end, value); + } + public static float Spring(float start, float end, float value) { value = Mathf.Clamp01(value); @@ -773,6 +779,11 @@ namespace RhythmHeavenMania.Util /// The easing function public static Function GetEasingFunction(Ease easingFunction) { + if (easingFunction == Ease.Instant) + { + return Instant; + } + if (easingFunction == Ease.EaseInQuad) { return EaseInQuad;