Syntriax.Engine/Engine.Core/Extensions/TransformExtensions.cs

15 lines
492 B
C#
Raw Normal View History

2024-01-30 12:57:27 +03:00
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;
}
}