docs.unity3d.com
    Show / Hide Table of Contents

    Struct CinemachineImpulseListener.ImpulseReaction

    This controls the secondary reaction of the listener to the incoming impulse.
    The impulse might be for example a sharp shock, and the secondary reaction could be a vibration whose amplitude and duration is controlled by the size of the original impulse. This allows different listeners to respond in different ways to the same impulse signal.

    Namespace: Cinemachine
    Syntax
    [Serializable]
    public struct ImpulseReaction

    Fields

    m_AmplitudeGain

    Gain to apply to the amplitudes defined in the signal source asset.

    Declaration
    [Tooltip("Gain to apply to the amplitudes defined in the signal source.  1 is normal.  Setting this to 0 completely mutes the signal.")]
    public float m_AmplitudeGain
    Field Value
    Type Description
    Single

    m_Duration

    How long the secondary reaction lasts.

    Declaration
    [Tooltip("How long the secondary reaction lasts.")]
    public float m_Duration
    Field Value
    Type Description
    Single

    m_FrequencyGain

    Scale factor to apply to the time axis.

    Declaration
    [Tooltip("Scale factor to apply to the time axis.  1 is normal.  Larger magnitudes will make the signal progress more rapidly.")]
    public float m_FrequencyGain
    Field Value
    Type Description
    Single

    m_SecondaryNoise

    Secondary shake that will be triggered by the primary impulse

    Declaration
    [Tooltip("Secondary shake that will be triggered by the primary impulse.")]
    public NoiseSettings m_SecondaryNoise
    Field Value
    Type Description
    NoiseSettings

    Methods

    GetReaction(Single, Vector3, out Vector3, out Quaternion)

    Get the rection effect for a given impulse at a given time.

    Declaration
    public bool GetReaction(float deltaTime, Vector3 impulsePos, out Vector3 pos, out Quaternion rot)
    Parameters
    Type Name Description
    Single deltaTime

    Current time interval

    Vector3 impulsePos

    The input impulse signal at this time

    Vector3 pos

    output reaction position delta

    Quaternion rot

    output reaction rotation delta

    Returns
    Type Description
    Boolean

    True if thewre is a reaction effect, false otherwise

    ReSeed()

    Generate a new random seed

    Declaration
    public void ReSeed()
    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