17 lines
672 B
C#
17 lines
672 B
C#
using Syntriax.Engine.Core;
|
|
|
|
namespace Syntriax.Engine.Systems.Tween;
|
|
|
|
public static class TweenLine2DEquationExtensions
|
|
{
|
|
public static ITween TweenLine2DEquation(this Line2DEquation initialLine2DEquation, ITweenManager tweenManager, float duration, Line2DEquation targetLine2DEquation, System.Action<Line2DEquation> setMethod)
|
|
=> tweenManager.StartTween(duration,
|
|
t => setMethod?.InvokeSafe(
|
|
new Line2DEquation(
|
|
initialLine2DEquation.Slope.Lerp(targetLine2DEquation.Slope, t),
|
|
initialLine2DEquation.OffsetY.Lerp(targetLine2DEquation.OffsetY, t)
|
|
)
|
|
)
|
|
);
|
|
}
|