using System.Diagnostics.Contracts; using System.Drawing; using System.Runtime.CompilerServices; using UnityEngine; namespace X10D.Unity.Drawing; /// /// Drawing-related extension methods for . /// public static class SizeExtensions { /// /// Converts the current to a . /// /// The size to convert. /// The resulting . [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2 ToUnityVector2(this Size size) { return new Vector2(size.Width, size.Height); } /// /// Converts the current to a . /// /// The size to convert. /// The resulting . [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2Int ToUnityVector2Int(this Size size) { return new Vector2Int(size.Width, size.Height); } }