cirnogodot/GTweensGodot/Godot/Source/Extensions/CurveExtensions.cs

19 lines
371 B
C#
Raw Normal View History

2025-02-24 11:52:50 +01:00
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;
}
}