2 Commits

Author SHA1 Message Date
3817ebebfe feat: Transform Extensions 2024-01-30 16:59:43 +03:00
fa7eeed267 feat: GameObject Extensions 2024-01-30 16:59:03 +03:00
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Core;
public static class GameObjectExtensions
{
public static IGameObject SetGameObject(this IGameObject gameObject, string name)
{
gameObject.Name = name;
return gameObject;
}
}

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;
}
}