BoundsUtility.cs 458 B

123456789101112131415
  1. using System;
  2. using System.Diagnostics;
  3. namespace InitialPrefabs.NimGui.Collections {
  4. internal static class BoundsUtility {
  5. [Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
  6. public static void CheckMinMax<T>(T min, T max) where T : unmanaged, IComparable<T> {
  7. if (min.CompareTo(max) > 0) {
  8. throw new InvalidOperationException($"The min value: {min} is greater than: {max}.");
  9. }
  10. }
  11. }
  12. }