Struct AxisState.Recentering
Helper for automatic axis recentering
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[Obsolete("AxisState.Recentering is deprecated. Use InputAxis and InputAxisController instead")]
[Serializable]
public struct AxisState.Recentering
Constructors
Recentering(bool, float, float)
Constructor with specific field values
Declaration
public Recentering(bool enabled, float waitTime, float recenteringTime)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled | whether recentering is enabled |
float | waitTime | wait this long before recentering |
float | recenteringTime | time to complete the recentering |
Fields
m_RecenteringTime
How long it takes to reach destination once recentering has started
Declaration
[Tooltip("How long it takes to reach destination once recentering has started.")]
public float m_RecenteringTime
Field Value
Type | Description |
---|---|
float |
m_WaitTime
If no input has been detected, the camera will wait this long in seconds before moving its heading to the default heading.
Declaration
[Tooltip("If no user input has been detected on the axis, the axis will wait this long in seconds before recentering.")]
public float m_WaitTime
Field Value
Type | Description |
---|---|
float |
m_enabled
If checked, will enable automatic recentering of the axis. If FALSE, recenting is disabled.
Declaration
[Tooltip("If checked, will enable automatic recentering of the axis. If unchecked, recenting is disabled.")]
public bool m_enabled
Field Value
Type | Description |
---|---|
bool |
Methods
CancelRecentering()
Cancel any recenetering in progress.
Declaration
public void CancelRecentering()
CopyStateFrom(ref Recentering)
Copy Recentering state from another Recentering component.
Declaration
public void CopyStateFrom(ref AxisState.Recentering other)
Parameters
Type | Name | Description |
---|---|---|
AxisState.Recentering | other | the source from which to copy |
DoRecentering(ref AxisState, float, float)
Bring the axis back to the centered state (only if enabled).
Declaration
public void DoRecentering(ref AxisState axis, float deltaTime, float recenterTarget)
Parameters
Type | Name | Description |
---|---|---|
AxisState | axis | The axis to recenter |
float | deltaTime | Current effective deltaTime |
float | recenterTarget | The value that is considered to be centered |
RecenterNow()
Skip the wait time and start recentering now (only if enabled).
Declaration
public void RecenterNow()
Validate()
Call this from OnValidate()
Declaration
public void Validate()