mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-17 11:13:47 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
19
GTweensGodot/Godot/Source/Extensions/CurveExtensions.cs
Normal file
19
GTweensGodot/Godot/Source/Extensions/CurveExtensions.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue