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

17 lines
411 B
C#

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;
}
}
}