cirnogodot/GTweensGodot/Godot/Source/Extensions/CurveExtensions.cs
2025-02-24 11:52:50 +01:00

19 lines
No EOL
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;
}
}