feat: Transform Extensions
This commit is contained in:
parent
fa7eeed267
commit
3817ebebfe
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue