GameVsJam/3d Prototyp/Assets/Scripts/Utility/TimeSpanExtension.cs

17 lines
411 B
C#
Raw Normal View History

2024-04-05 13:54:38 +02:00
using System;
namespace Utility
{
public static class TimeSpanExtension
{
public static bool IsBetween(this TimeSpan value, TimeSpan start, TimeSpan end)
{
if (start > end)
{
throw new ArgumentException(nameof(start), "start must be before end.");
}
return value >= start && value <= end;
}
}
}