UnityUtilities
UnityUtilities.RangeFloat Class Reference

Provides input for a float value range in the editor and various convencience functions to work with that range. More...

Public Member Functions

 RangeFloat ()
 Create a RangeFloat with 0-0 as the range. Needed for the editor. More...
 
 RangeFloat (float @from, float to)
 Create a RangeFloat with a certain range. More...
 
float Lerp (float t)
 Linearly interpolates between to and from by t. More...
 
float LerpUnclamped (float t)
 Linearly interpolates between to and from by t. More...
 
float InverseLerp (float value)
 Calculates the linear parameter t that produces the interpolant value within the range [from, to]. More...
 

Properties

float From [get]
 The range start. More...
 
float To [get]
 The range end. More...
 
float Range [get]
 Returns how wide the range between from and to is. More...
 
float RandomInclusive [get]
 Returns a random number between from [inclusive] and to [inclusive]. More...
 

Detailed Description

Provides input for a float value range in the editor and various convencience functions to work with that range.

Constructor & Destructor Documentation

§ RangeFloat() [1/2]

UnityUtilities.RangeFloat.RangeFloat ( )

Create a RangeFloat with 0-0 as the range. Needed for the editor.

§ RangeFloat() [2/2]

UnityUtilities.RangeFloat.RangeFloat ( float @  from,
float  to 
)

Create a RangeFloat with a certain range.

Parameters
fromLower range bound.
toUpper range bound.

Member Function Documentation

§ InverseLerp()

float UnityUtilities.RangeFloat.InverseLerp ( float  value)

Calculates the linear parameter t that produces the interpolant value within the range [from, to].

Parameters
value
Returns

§ Lerp()

float UnityUtilities.RangeFloat.Lerp ( float  t)

Linearly interpolates between to and from by t.

Parameters
tHow much to interpolate. Clamped between 0 and 1. 0 is [to] and 1 is [from].
Returns

§ LerpUnclamped()

float UnityUtilities.RangeFloat.LerpUnclamped ( float  t)

Linearly interpolates between to and from by t.

Parameters
tHow much to interpolate. 0 is [to] and 1 is [from].
Returns

Property Documentation

§ From

float UnityUtilities.RangeFloat.From
get

The range start.

§ RandomInclusive

float UnityUtilities.RangeFloat.RandomInclusive
get

Returns a random number between from [inclusive] and to [inclusive].

§ Range

float UnityUtilities.RangeFloat.Range
get

Returns how wide the range between from and to is.

§ To

float UnityUtilities.RangeFloat.To
get

The range end.


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