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 TweenLine2DExtensions
|
||||
{
|
||||
public static ITween TweenLine2D(this Line2D initialLine2D, ITweenManager tweenManager, float duration, Line2D targetLine2D, System.Action<Line2D> setMethod)
|
||||
=> tweenManager.StartTween(duration,
|
||||
t => setMethod?.InvokeSafe(
|
||||
new Line2D(
|
||||
initialLine2D.From.Lerp(targetLine2D.From, t),
|
||||
initialLine2D.To.Lerp(targetLine2D.To, t)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user