feat: added engine member tween extensions
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user