Struct InputAxis
Defines an input axis. This is a field that can take on any value in a range, with optional wrapping to form a loop.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: solution.dll
Syntax
[Serializable]
public struct InputAxis
Fields
| Name | Description |
|---|---|
| Center | The centered, or at-rest value of this axis. |
| Range | The valid range for the axis value. Value will be clamped to this range. |
| Recentering | Controls automatic re-centering of axis |
| Restrictions | Some usages require restricted functionality. This is set here. |
| Value | The current value of the axis. You can drive this directly from a script |
| Wrap | If set, then the axis will wrap around at the min/max values, forming a loop |
Properties
| Name | Description |
|---|---|
| DefaultMomentary | An InputAxis set up as a normalized momentary control ranging from -1...1 with Center = 0 |
Methods
| Name | Description |
|---|---|
| CancelRecentering() | Cancel any current re-centering in progress, and reset the wait time |
| ClampValue(float) | Clamp the value to range, taking wrap into account |
| GetClampedValue() | Get the clamped axis value |
| GetNormalizedValue() | Clamp and scale the value to range 0...1, taking wrap into account |
| Reset() | Reset axis to at-rest state |
| TrackValueChange() | Call this before calling UpdateRecentering. Will track any value changes so that the re-centering clock is updated properly. |
| TriggerRecentering() | Trigger re-centering immediately, regardless of whether re-centering is enabled or the wait time has elapsed. |
| UpdateRecentering(float, bool) | Call this to manage re-centering axis value to axis center. This assumes that TrackValueChange() has been called already this frame. |
| Validate() | Make sure the settings are well-formed |