feat: Transform Extensions

This commit is contained in:
Syntriax 2024-01-30 12:57:27 +03:00
parent fa7eeed267
commit 3817ebebfe
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Core;
public static class TransformExtensions
{
public static ITransform SetTransform(this ITransform transform, Vector2D? position = null, float? rotation = null, Vector2D? scale = null)
{
if (position.HasValue) transform.Position = position.Value;
if (rotation.HasValue) transform.Rotation = rotation.Value;
if (scale.HasValue) transform.Scale = scale.Value;
return transform;
}
}