18 lines
643 B
C#
18 lines
643 B
C#
using System;
|
|
using Syntriax.Engine.Core;
|
|
|
|
namespace Syntriax.Engine.Systems.Tween;
|
|
|
|
public static class TweenProjection1DExtensions
|
|
{
|
|
public static ITween TweenProjection1D(this Projection1D initialProjection1D, ITweenManager tweenManager, float duration, Projection1D targetProjection1D, Action<Projection1D> setMethod)
|
|
=> tweenManager.StartTween(duration,
|
|
t => setMethod?.InvokeSafe(
|
|
new Projection1D(
|
|
initialProjection1D.Min.Lerp(targetProjection1D.Min, t),
|
|
initialProjection1D.Max.Lerp(targetProjection1D.Max, t)
|
|
)
|
|
)
|
|
);
|
|
}
|