15 public static float Loop(
this float floatToBeLooped,
float exclusiveMaximum,
float inclusiveMinimum = 0f,
float variancePerStep = 1f)
17 float returnInt = floatToBeLooped + variancePerStep;
18 if (returnInt >= exclusiveMaximum)
19 returnInt = inclusiveMinimum;
31 public static float Map(
this float value,
float originalRangeMin,
float originalRangeMax,
float newRangeMin = 0f,
float newRangeMax = 1f)
33 return ((value - originalRangeMin) / (originalRangeMax - originalRangeMin) * (newRangeMax - newRangeMin)) + newRangeMin;
static float Map(this float value, float originalRangeMin, float originalRangeMax, float newRangeMin=0f, float newRangeMax=1f)
Maps the value from one range to another range.
static float Loop(this float floatToBeLooped, float exclusiveMaximum, float inclusiveMinimum=0f, float variancePerStep=1f)
Loops the float between a minimum and maximum.