![]() |
Lemmings
Remappable Gestures For Unity
|
Represents an integer value with normalized remapping, directional interpolation, and support for flexible out-of-range behavior via Lemmings.LemmingInter.RangeBindingMode. More...
Inherits Lemmings.ILemmingConverter.
Public Types | |
| enum | RangeBindingMode { Clamped , CycleUp , CycleDown , Oscillate , None } |
| Specifies how a value behaves outside its [min, max] range. More... | |
Public Member Functions | |
| LemmingInter (int raw, int min, int max, RangeBindingMode mode) | |
| Initializes a new instance of the Lemmings.LemmingInter struct. | |
| void | ApplyBounds (RangeBindingMode mode) |
| Applies a specified bounding mode to the current value. | |
| int | Clamp () |
| Clamps the current value to the [min, max] range. | |
| float | ToFloatRange (float outMin, float outMax) |
| Remaps the normalized value to a float in a specified output range. | |
| int | ToIndex (int arraySize) |
| Converts the normalized value to an index within an array. | |
| int | ToIntRange (int minimum, int maximum) |
| Remaps the normalized value to an integer range. | |
| string | ToLabel (string[] labels) |
| Maps the current value to a label from a list using normalized indexing. | |
| T | ToEnum< T > () |
| Maps the current value to a member of the specified enum using normalized indexing. | |
| float | ToCurve (AnimationCurve curve) |
| Evaluates the normalized value on a Unity AnimationCurve. | |
| Vector3 | ToVector (Vector3 vectorA, Vector3 vectorB) |
| Interpolates between two vectors using the normalized value. | |
| Quaternion | ToQuaternion (Quaternion a, Quaternion b) |
| Interpolates between two rotations using the normalized value. | |
| Quaternion | ToRotationAroundAxis (Vector3 axis, float minAngle, float maxAngle) |
| Remaps the normalized value to a rotation around a specified axis. | |
| Quaternion | ToLookRotation (Vector3 from, Vector3 to) |
| Creates a look rotation between two vectors based on the normalized value. | |
| override string | ToString () |
| Returns a string representation of the current state for debugging purposes. | |
| void | SetValue (int newValue) |
| Sets a new value and automatically applies the configured binding mode. | |
| void | SetRange (int newMin, int newMax) |
| Updates the min and max range of the struct. | |
| void | SetBindingMode (RangeBindingMode mode) |
| Sets a new Lemmings.LemmingInter.RangeBindingMode for how the value should behave when outside the range. | |
| void | Reset (int newValue, int newMin, int newMax) |
| Resets the value and range all at once, applying the current binding mode. | |
| void | ApplyCurrentBinding () |
| Applies the stored bindingMode to the current value. This is a convenience method for using the configured range behavior directly. | |
Data Fields | |
| int | raw |
| The current integer value. | |
| int | min |
| The minimum boundary of the value range. | |
| int | max |
| The maximum boundary of the value range. | |
| RangeBindingMode | bindingMode |
| Determines how the value should behave when it exceeds the defined range. | |
Properties | |
| object | Raw [get] |
| float | Normalized [get] |
| Returns the current value normalized to a float in [0, 1], based on the configured min and max values. | |
| bool | Over [get] |
| Returns true if the value is greater than or equal to max. | |
| bool | InRange [get] |
| Returns true if the value is within the specified range. | |
| bool | Under [get] |
| Returns true if the value is less than or equal to min. | |
| float | AsAxis [get] |
| This provides the normalized value in a range of -1 to 1, useful for input mapping and relative values. | |
Represents an integer value with normalized remapping, directional interpolation, and support for flexible out-of-range behavior via Lemmings.LemmingInter.RangeBindingMode.
Specifies how a value behaves outside its [min, max] range.
|
inline |
Initializes a new instance of the Lemmings.LemmingInter struct.
| raw | The initial value. |
| min | Minimum range value. |
| max | Maximum range value. |
| mode | How the value should behave when out of range. |
| ArgumentException | Thrown if min and max are equal. |
|
inline |
Applies a specified bounding mode to the current value.
| mode | The binding mode to apply. Note that Oscillate requires a state to fully function |
| int Lemmings.LemmingInter.Clamp | ( | ) |
Clamps the current value to the [min, max] range.
|
inline |
Resets the value and range all at once, applying the current binding mode.
| newValue | New value. |
| newMin | New minimum range. |
| newMax | New maximum range. |
| ArgumentException | Thrown if newMin equals newMax. |
|
inline |
Sets a new Lemmings.LemmingInter.RangeBindingMode for how the value should behave when outside the range.
| mode | The new binding mode to apply. |
|
inline |
Updates the min and max range of the struct.
| newMin | New minimum value. |
| newMax | New maximum value. |
| ArgumentException | Thrown if newMin equals newMax. |
|
inline |
Sets a new value and automatically applies the configured binding mode.
| newValue | The new value to assign. |
|
inline |
Evaluates the normalized value on a Unity AnimationCurve.
| curve | The curve to evaluate. |
Implements Lemmings.ILemmingConverter.
|
inline |
Maps the current value to a member of the specified enum using normalized indexing.
| T | The enum type to map to. |
| T | : | Enum |
|
inline |
Remaps the normalized value to a float in a specified output range.
| outMin | Minimum float output. |
| outMax | Maximum float output. |
|
inline |
Converts the normalized value to an index within an array.
| arraySize | The size of the array. |
|
inline |
Remaps the normalized value to an integer range.
| minimum | Minimum integer output value. |
| maximum | Maximum integer output value. |
|
inline |
Maps the current value to a label from a list using normalized indexing.
| labels | An array of string labels. |
|
inline |
Creates a look rotation between two vectors based on the normalized value.
| from | Starting direction. |
| to | Target direction. |
|
inline |
Interpolates between two rotations using the normalized value.
| a | Start rotation. |
| b | End rotation. |
|
inline |
Remaps the normalized value to a rotation around a specified axis.
| axis | Axis to rotate around. |
| minAngle | Minimum rotation in degrees. |
| maxAngle | Maximum rotation in degrees. |
|
inline |
Interpolates between two vectors using the normalized value.
| vectorA | Start vector. |
| vectorB | End vector. |
|
get |
This provides the normalized value in a range of -1 to 1, useful for input mapping and relative values.
Implements Lemmings.ILemmingConverter.
|
get |
Returns true if the value is within the specified range.
Implements Lemmings.ILemmingConverter.
|
get |
Returns the current value normalized to a float in [0, 1], based on the configured min and max values.
Implements Lemmings.ILemmingConverter.
|
get |
Returns true if the value is greater than or equal to max.
Implements Lemmings.ILemmingConverter.
|
get |
Implements Lemmings.ILemmingConverter.
|
get |
Returns true if the value is less than or equal to min.
Implements Lemmings.ILemmingConverter.