Compare commits
2 Commits
07666359f2
...
3817ebebfe
Author | SHA1 | Date | |
---|---|---|---|
3817ebebfe | |||
fa7eeed267 |
12
Engine.Core/Extensions/GameObjectExtensions.cs
Normal file
12
Engine.Core/Extensions/GameObjectExtensions.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
14
Engine.Core/Extensions/TransformExtensions.cs
Normal file
14
Engine.Core/Extensions/TransformExtensions.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user