mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Instant camera easing
This commit is contained in:
parent
5098ca135d
commit
49b1f9a5c2
1 changed files with 11 additions and 0 deletions
|
@ -64,6 +64,7 @@ namespace RhythmHeavenMania.Util
|
||||||
public enum Ease
|
public enum Ease
|
||||||
{
|
{
|
||||||
Linear = 0,
|
Linear = 0,
|
||||||
|
Instant,
|
||||||
EaseInQuad,
|
EaseInQuad,
|
||||||
EaseOutQuad,
|
EaseOutQuad,
|
||||||
EaseInOutQuad,
|
EaseInOutQuad,
|
||||||
|
@ -108,6 +109,11 @@ namespace RhythmHeavenMania.Util
|
||||||
return Mathf.Lerp(start, end, value);
|
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)
|
public static float Spring(float start, float end, float value)
|
||||||
{
|
{
|
||||||
value = Mathf.Clamp01(value);
|
value = Mathf.Clamp01(value);
|
||||||
|
@ -773,6 +779,11 @@ namespace RhythmHeavenMania.Util
|
||||||
/// <returns>The easing function</returns>
|
/// <returns>The easing function</returns>
|
||||||
public static Function GetEasingFunction(Ease easingFunction)
|
public static Function GetEasingFunction(Ease easingFunction)
|
||||||
{
|
{
|
||||||
|
if (easingFunction == Ease.Instant)
|
||||||
|
{
|
||||||
|
return Instant;
|
||||||
|
}
|
||||||
|
|
||||||
if (easingFunction == Ease.EaseInQuad)
|
if (easingFunction == Ease.EaseInQuad)
|
||||||
{
|
{
|
||||||
return EaseInQuad;
|
return EaseInQuad;
|
||||||
|
|
Loading…
Reference in a new issue