8 lines
206 B
C#
8 lines
206 B
C#
public static class FloatExtensions
|
|
{
|
|
public static float MapRange(this float value, float min1, float max1, float min2, float max2)
|
|
{
|
|
return (value - min1) / (max1 - min1) * (max2 - min2) + min2;
|
|
}
|
|
}
|