HeavenStudio/Assets/Scripts/Util/MathUtils.cs
minenice55 dd9a06ad52
Change Project License to MIT (#700)
* license change

replace unneeded package

* reword this
2024-02-16 06:17:16 +00:00

22 lines
535 B
C#

using UnityEngine;
namespace HeavenStudio.Util
{
public static class MathUtils
{
public static float Round2Nearest(float value, float nearest)
{
return Mathf.Round(value / nearest) * nearest;
}
public static float Normalize(float value, float min, float max)
{
return (value - min) / (max - min);
}
public static bool IsBetween(this float value, float min, float max)
{
return value >= min && value <= max;
}
}
}