fix: added missing types for new primitives

This commit is contained in:
2025-10-19 19:03:30 +03:00
parent f8096377b2
commit b42f1f1881
19 changed files with 526 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
using Engine.Core;
namespace Engine.Systems.Tween;
public static class TweenLine3DExtensions
{
private static readonly BoxedPool<Line3D> boxedLine3DPool = new(2);
public static ITween TweenLine3D(this Line3D initialLine3D, ITweenManager tweenManager, float duration, Line3D targetLine3D, System.Action<Line3D> setMethod)
{
Boxed<Line3D> boxedInitial = boxedLine3DPool.Get(initialLine3D);
Boxed<Line3D> boxedTarget = boxedLine3DPool.Get(targetLine3D);
ITween tween = tweenManager.StartTween(duration,
t => setMethod?.Invoke(
new Line3D(
boxedInitial.Value.From.Lerp(boxedTarget.Value.From, t),
boxedInitial.Value.To.Lerp(boxedTarget.Value.To, t)
)
)
);
tween.OnComplete(() =>
{
boxedLine3DPool.Return(boxedInitial);
boxedLine3DPool.Return(boxedTarget);
});
return tween;
}
}