UnityEssentials
Small but useful tools and features for Unity
Static Public Member Functions | List of all members
UnityEngine.FloatExtensions Class Reference

Extensions for float More...

Collaboration diagram for UnityEngine.FloatExtensions:
Collaboration graph

Static Public Member Functions

static float Loop (this float floatToBeLooped, float exclusiveMaximum, float inclusiveMinimum=0f, float variancePerStep=1f)
 Loops the float between a minimum and maximum. More...
 
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. More...
 

Detailed Description

Extensions for float

Definition at line 6 of file FloatExtensions.cs.

Member Function Documentation

◆ Loop()

static float UnityEngine.FloatExtensions.Loop ( this float  floatToBeLooped,
float  exclusiveMaximum,
float  inclusiveMinimum = 0f,
float  variancePerStep = 1f 
)
static

Loops the float between a minimum and maximum.

Parameters
exclusiveMaximumThe exclusive maximum value than can be obtained.
inclusiveMinimumThe minimum value that can be obtained.
variancePerStepThe value added to the int every time that the method is called.
Returns
Returns a the result of adding the 'variancePerStep' (default to 1f) to the original integer. The value is always between the minimum (inclusive, default to 0f) and the maximum (exclusive).

Definition at line 15 of file FloatExtensions.cs.

◆ Map()

static float UnityEngine.FloatExtensions.Map ( this float  value,
float  originalRangeMin,
float  originalRangeMax,
float  newRangeMin = 0f,
float  newRangeMax = 1f 
)
static

Maps the value from one range to another range.

Parameters
originalRangeMinThe minimum value in the original range.
originalRangeMaxThe maximum value in the original range.
newRangeMinThe minimum value in the new range.
newRangeMaxThe maximum value in the new range.
Returns
The value mapped to the new range from the original one.

Definition at line 31 of file FloatExtensions.cs.


The documentation for this class was generated from the following file: