13 lines
400 B
C#
13 lines
400 B
C#
using Syntriax.Engine.Core;
|
|
|
|
namespace Syntriax.Engine.Systems.Tween;
|
|
|
|
public static class TweenCamera2DExtensions
|
|
{
|
|
public static ITween TweenZoom(this ICamera2D camera2D, ITweenManager tweenManager, float duration, float targetZoom)
|
|
{
|
|
float initialZoom = camera2D.Zoom;
|
|
return tweenManager.StartTween(duration, t => camera2D.Zoom = initialZoom.Lerp(targetZoom, t));
|
|
}
|
|
}
|