Struct AxisState
Axis state for defining how to react to player input. The settings here control the responsiveness of the axis to player input.
Namespace: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[Serializable]
public struct AxisStateConstructors
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_AccelTimeField 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_DecelTimeField 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_InputAxisNameField 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_InputAxisValueField 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_InvertInputField 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_MaxSpeedField Value
| Type | Description | 
|---|---|
| System.Single | 
m_MaxValue
The maximum value for the axis
Declaration
public float m_MaxValueField Value
| Type | Description | 
|---|---|
| System.Single | 
m_MinValue
The minimum value for the axis
Declaration
public float m_MinValueField Value
| Type | Description | 
|---|---|
| System.Single | 
m_Recentering
Automatic recentering. Valid only if HasRecentering is true
Declaration
public AxisState.Recentering m_RecenteringField Value
| Type | Description | 
|---|---|
| AxisState.Recentering | 
m_Wrap
If checked, then the axis will wrap around at the min/max values, forming a loop
Declaration
public bool m_WrapField Value
| Type | Description | 
|---|---|
| System.Boolean | 
Value
The current value of the axis
Declaration
public float ValueField Value
| Type | Description | 
|---|---|
| System.Single | 
Properties
HasRecentering
True if the Recentering member is valid (bcak-compatibility support: old versions had recentering in a separate structure)
Declaration
public bool HasRecentering { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
ValueRangeLocked
Value range is locked, i.e. not adjustable by the user (used by editor)
Declaration
public bool ValueRangeLocked { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Methods
Reset()
Declaration
public void Reset()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, false otherwise | 
Validate()
Call from OnValidate: Make sure the fields are sensible
Declaration
public void Validate()