feat: Transform Extensions
This commit is contained in:
		
							
								
								
									
										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