Struct AxisState
Axis state for defining how to react to player input.
The settings here control the responsiveness of the axis to player input.
Inherited Members
Namespace: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
public struct AxisState
Constructors
AxisState(Single, Single, Boolean, Boolean, Single, Single, Single, String, Boolean)
Constructor with specific values
Declaration
public AxisState(float minValue, float maxValue, bool wrap, bool rangeLocked, float maxSpeed, float accelTime, float decelTime, string name, bool invert)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | minValue | |
| System.Single | maxValue | |
| System.Boolean | wrap | |
| System.Boolean | rangeLocked | |
| System.Single | maxSpeed | |
| System.Single | accelTime | |
| System.Single | decelTime | |
| System.String | name | |
| System.Boolean | invert |
Fields
m_AccelTime
The amount of time in seconds it takes to accelerate to MaxSpeed with the supplied Axis at its maximum value
Declaration
public float m_AccelTime
Field Value
| Type | Description |
|---|---|
| System.Single |
m_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
public float m_DecelTime
Field Value
| Type | Description |
|---|---|
| System.Single |
m_InputAxisName
The name of this axis as specified in Unity Input manager. Setting to an empty string will disable the automatic updating of this axis
Declaration
public string m_InputAxisName
Field Value
| Type | Description |
|---|---|
| System.String |
m_InputAxisValue
The value of the input axis. A value of 0 means no input You can drive this directly from a custom input system, or you can set the Axis Name and have the value driven by the internal Input Manager
Declaration
public float m_InputAxisValue
Field Value
| Type | Description |
|---|---|
| System.Single |
m_InvertInput
If checked, then the raw value of the input axis will be inverted before it is used.
Declaration
public bool m_InvertInput
Field Value
| Type | Description |
|---|---|
| System.Boolean |
m_MaxSpeed
How fast the axis value can travel. Increasing this number makes the behaviour more responsive to joystick input
Declaration
public float m_MaxSpeed
Field Value
| Type | Description |
|---|---|
| System.Single |
m_MaxValue
The maximum value for the axis
Declaration
public float m_MaxValue
Field Value
| Type | Description |
|---|---|
| System.Single |
m_MinValue
The minimum value for the axis
Declaration
public float m_MinValue
Field Value
| Type | Description |
|---|---|
| System.Single |
m_Wrap
If checked, then the axis will wrap around at the min/max values, forming a loop
Declaration
public bool m_Wrap
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Value
The current value of the axis
Declaration
public float Value
Field Value
| Type | Description |
|---|---|
| System.Single |
Methods
Update(Single)
Updates the state of this axis based on the axis defined by AxisState.m_AxisName
Declaration
public bool Update(float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | deltaTime | Delta time in seconds |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if this axis' input was non-zero this Update, flase otherwise |
Validate()
Call from OnValidate: Make sure the fields are sensible
Declaration
public void Validate()