Instant camera easing

This commit is contained in:
Braedon 2022-02-04 17:54:38 -05:00
parent 5098ca135d
commit 49b1f9a5c2

View file

@ -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
/// <returns>The easing function</returns>
public static Function GetEasingFunction(Ease easingFunction)
{
if (easingFunction == Ease.Instant)
{
return Instant;
}
if (easingFunction == Ease.EaseInQuad)
{
return EaseInQuad;