Struct AxisState.Recentering
Helper for automatic axis recentering
Namespace: Cinemachine
Syntax
[DocumentationSorting(DocumentationSortingAttribute.Level.UserRef)]
[Serializable]
public struct Recentering
Constructors
Recentering(Boolean, Single, Single)
Constructor with specific field values
Declaration
public Recentering(bool enabled, float waitTime, float recenteringTime)
Parameters
Type | Name | Description |
---|---|---|
Boolean | enabled | |
Single | waitTime | |
Single | recenteringTime |
Fields
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 |
---|---|
Boolean |
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 |
---|---|
Single |
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 |
---|---|
Single |
Methods
CancelRecentering()
Cancel any recenetering in progress.
Declaration
public void CancelRecentering()
CopyStateFrom(ref AxisState.Recentering)
Copy Recentering state from another Recentering component.
Declaration
public void CopyStateFrom(ref AxisState.Recentering other)
Parameters
Type | Name | Description |
---|---|---|
AxisState.Recentering | other |
DoRecentering(ref AxisState, Single, Single)
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 |
Single | deltaTime | Current effective deltaTime |
Single | 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()