Struct DefaultInputAxisDriver
This object drives an input axis. It reads raw input, applies it to the axis value, with acceleration and deceleration.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[Serializable]
public struct DefaultInputAxisDriver
Fields
AccelTime
The amount of time in seconds it takes to accelerate to MaxSpeed with the supplied Axis at its maximum value
Declaration
[Tooltip("The amount of time in seconds it takes to accelerate to MaxSpeed with the supplied Axis at its maximum value")]
public float AccelTime
Field Value
| Type | Description |
|---|---|
| float |
DecelTime
The amount of time in seconds it takes to decelerate the axis to zero if the supplied axis is in a neutral position
Declaration
[Tooltip("The amount of time in seconds it takes to decelerate the axis to zero if the supplied axis is in a neutral position")]
public float DecelTime
Field Value
| Type | Description |
|---|---|
| float |
Properties
Default
Default value
Declaration
public static DefaultInputAxisDriver Default { get; }
Property Value
| Type | Description |
|---|---|
| DefaultInputAxisDriver |
Methods
CancelCurrentInput(ref InputAxis)
Cancel any current input, resetting the speed to zero. This will eliminate any residual acceleration or deceleration of the input value.
Declaration
public void CancelCurrentInput(ref InputAxis axis)
Parameters
| Type | Name | Description |
|---|---|---|
| InputAxis | axis | The axis in question |
ProcessInput(ref InputAxis, float, float)
Apply the input value to the axis value
Declaration
public void ProcessInput(ref InputAxis axis, float inputValue, float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| InputAxis | axis | The InputAxisValue to update |
| float | inputValue | The input value to apply to the axis value. |
| float | deltaTime | current deltaTime |
Reset(ref InputAxis)
Reset an axis to at-rest state
Declaration
public void Reset(ref InputAxis axis)
Parameters
| Type | Name | Description |
|---|---|---|
| InputAxis | axis | The axis to reset |
Validate()
Call from OnValidate: Make sure the fields are sensible
Declaration
public void Validate()