Struct AxisState.Recentering | Cinemachine | 2.5.0
docs.unity3d.com
    Show / Hide Table of Contents

    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)

    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
    Single deltaTime
    Single recenterTarget

    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()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023