mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 20:15:53 +00:00
19 lines
371 B
C#
19 lines
371 B
C#
|
|
using Godot;
|
|||
|
|
using GTweens.Easings;
|
|||
|
|
|
|||
|
|
namespace GTweensGodot.Extensions;
|
|||
|
|
|
|||
|
|
public static class CurveExtensions
|
|||
|
|
{
|
|||
|
|
public static EasingDelegate ToEasingDelegate(this Curve curve)
|
|||
|
|
{
|
|||
|
|
float Result(float a, float b, float t)
|
|||
|
|
{
|
|||
|
|
float newT = curve.Sample(t);
|
|||
|
|
|
|||
|
|
return a + ((b - a) * newT);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Result;
|
|||
|
|
}
|
|||
|
|
}
|