mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-05-02 22:54:27 +02:00

* move prefabs and music out of resources lower "real" audio cap update some packages * new game switch look audio optimizations * import SFB as package instead of plugin use updated SFB fork * fix game switch events * delete effect for game switch * new look for chart end * update Jukebox to 0.2.4 * fix outline ordering * re-isolated fan club sfx * move more stuff out of resources further reduce audiomanager virtual voices * fix rendering of other GameManager blocks
32 lines
826 B
C#
32 lines
826 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 int value, int min, int max)
|
|
{
|
|
return value >= min && value <= max;
|
|
}
|
|
|
|
public static bool IsBetween(this float value, float min, float max)
|
|
{
|
|
return value >= min && value <= max;
|
|
}
|
|
|
|
public static bool IsBetween(this double value, double min, double max)
|
|
{
|
|
return value >= min && value <= max;
|
|
}
|
|
}
|
|
} |