docs.unity3d.com
    Show / Hide Table of Contents

    Struct CinemachineInputAxisDriver

    A helper class to drive an input axis, as an alternative to the standard Cinemachine.AxisState. Behaviour is a simple direct scaling of the input channel, with no max speed.

    Namespace: Cinemachine
    Syntax
    [Serializable]
    public struct CinemachineInputAxisDriver

    Fields

    accelTime

    The amount of time in seconds it takes to accelerate to a higher speed

    Declaration
    [Tooltip("The amount of time in seconds it takes to accelerate to a higher speed")]
    public float accelTime
    Field Value
    Type Description
    Single

    decelTime

    The amount of time in seconds it takes to decelerate to a lower speed

    Declaration
    [Tooltip("The amount of time in seconds it takes to decelerate to a lower speed")]
    public float decelTime
    Field Value
    Type Description
    Single

    inputValue

    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
    [Tooltip("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")]
    public float inputValue
    Field Value
    Type Description
    Single

    multiplier

    Multiply the input by this amount prior to processing. Controls the input power

    Declaration
    [Tooltip("Multiply the input by this amount prior to processing.  Controls the input power.")]
    public float multiplier
    Field Value
    Type Description
    Single

    name

    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
    [Tooltip("The name of this axis as specified in Unity Input manager. Setting to an empty string will disable the automatic updating of this axis")]
    public string name
    Field Value
    Type Description
    String

    Methods

    Update(Single, ref AxisBase)

    Update the axis

    Declaration
    public bool Update(float deltaTime, ref AxisBase axis)
    Parameters
    Type Name Description
    Single deltaTime

    current deltaTime

    AxisBase axis

    The AxisState to update

    Returns
    Type Description
    Boolean

    True if the axis value changed due to user input, false otherwise

    Update(Single, ref AxisState)

    Support for legacy AxisState struct: update the axis

    Declaration
    public bool Update(float deltaTime, ref AxisState axis)
    Parameters
    Type Name Description
    Single deltaTime

    current deltaTime

    AxisState axis

    The AxisState to update

    Returns
    Type Description
    Boolean

    True if the axis value changed due to user input, false otherwise

    Validate()

    Call from OnValidate: Make sure the fields are sensible

    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