This type represents a range inclusive of two values, and can remap a value from one range to another.
More...
|
| InputRange (float value0, float value1, InputRangeType type) |
|
| InputRange (InputRangeType type) |
| Initializes a new range from a predefined type. More...
|
|
bool | Includes (float value) |
| Check whether a value falls within of this range. More...
|
|
bool | Excludes (float value) |
| Check whether a value falls outside of this range. More...
|
|
|
static bool | Excludes (InputRangeType rangeType, float value) |
| Check whether a value falls outside of a specified range. More...
|
|
static float | Remap (float value, InputRange sourceRange, InputRange targetRange) |
| Remap the specified value, from one range to another. More...
|
|
static float | Remap (float value, InputRangeType sourceRangeType, InputRangeType targetRangeType) |
| Remap the specified value, from one range to another. More...
|
|
|
static readonly InputRange | None = new InputRange( 0.0f, 0.0f, InputRangeType.None ) |
|
static readonly InputRange | MinusOneToOne = new InputRange( -1.0f, 1.0f, InputRangeType.MinusOneToOne ) |
|
static readonly InputRange | OneToMinusOne = new InputRange( 1.0f, -1.0f, InputRangeType.OneToMinusOne ) |
|
static readonly InputRange | ZeroToOne = new InputRange( 0.0f, 1.0f, InputRangeType.ZeroToOne ) |
|
static readonly InputRange | ZeroToMinusOne = new InputRange( 0.0f, -1.0f, InputRangeType.ZeroToMinusOne ) |
|
static readonly InputRange | OneToZero = new InputRange( 1.0f, 0.0f, InputRangeType.OneToZero ) |
|
static readonly InputRange | MinusOneToZero = new InputRange( -1.0f, 0.0f, InputRangeType.MinusOneToZero ) |
|
static readonly InputRange[] | typeToRange |
|
This type represents a range inclusive of two values, and can remap a value from one range to another.
◆ InputRange()
Initializes a new range from a predefined type.
◆ Excludes() [1/2]
bool Excludes |
( |
float |
value | ) |
|
Check whether a value falls outside of this range.
- Returns
true
, if the value falls outside this range, false
otherwise.
- Parameters
-
◆ Excludes() [2/2]
static bool Excludes |
( |
InputRangeType |
rangeType, |
|
|
float |
value |
|
) |
| |
|
static |
Check whether a value falls outside of a specified range.
- Returns
true
, if the value falls outside this range, false
otherwise.
- Parameters
-
rangeType | The range to check against. |
value | The value to check. |
◆ Includes()
bool Includes |
( |
float |
value | ) |
|
Check whether a value falls within of this range.
- Returns
true
, if the value falls within this range, false
otherwise.
- Parameters
-
◆ Remap() [1/2]
Remap the specified value, from one range to another.
- Parameters
-
value | The value to remap. |
sourceRange | The source range to map from. |
targetRange | The target range to map to. |
◆ Remap() [2/2]
static float Remap |
( |
float |
value, |
|
|
InputRangeType |
sourceRangeType, |
|
|
InputRangeType |
targetRangeType |
|
) |
| |
|
static |
Remap the specified value, from one range to another.
- Parameters
-
value | The value to remap. |
sourceRangeType | The source range to map from. |
targetRangeType | The target range to map to. |
◆ Type
readonly InputRangeType Type |
An enum type of the range.
◆ typeToRange
Initial value:=
{
None,
MinusOneToOne,
OneToMinusOne,
ZeroToOne,
ZeroToMinusOne,
OneToZero,
MinusOneToZero,
}
◆ Value0
The first value in the range.
◆ Value1
The second value in the range.
The documentation for this struct was generated from the following file:
- Assets/InControl/Source/Control/InputRange.cs