Struct CinemachineImpulseManager.EnvelopeDefinition | Cinemachine | 2.5.0
docs.unity3d.com
    Show / Hide Table of Contents

    Struct CinemachineImpulseManager.EnvelopeDefinition

    This defines the time-envelope of the signal. Thie raw signal will be scaled to fit inside the envelope.

    Namespace: Cinemachine
    Syntax
    [Serializable]
    public struct EnvelopeDefinition

    Fields

    m_AttackShape

    Normalized curve defining the shape of the start of the envelope.

    Declaration
    [Tooltip("Normalized curve defining the shape of the start of the envelope.  If blank a default curve will be used")]
    public AnimationCurve m_AttackShape
    Field Value
    Type Description
    AnimationCurve

    m_AttackTime

    Duration in seconds of the attack. Attack curve will be scaled to fit. Must be >= 0

    Declaration
    [Tooltip("Duration in seconds of the attack.  Attack curve will be scaled to fit.  Must be >= 0.")]
    public float m_AttackTime
    Field Value
    Type Description
    Single

    m_DecayShape

    Normalized curve defining the shape of the end of the envelope.

    Declaration
    [Tooltip("Normalized curve defining the shape of the end of the envelope.  If blank a default curve will be used")]
    public AnimationCurve m_DecayShape
    Field Value
    Type Description
    AnimationCurve

    m_DecayTime

    Duration in seconds of the decay. Decay curve will be scaled to fit. Must be >= 0.

    Declaration
    [Tooltip("Duration in seconds of the decay.  Decay curve will be scaled to fit.  Must be >= 0.")]
    public float m_DecayTime
    Field Value
    Type Description
    Single

    m_HoldForever

    If true, then duration is infinite.

    Declaration
    [Tooltip("If true, then duration is infinite.")]
    public bool m_HoldForever
    Field Value
    Type Description
    Boolean

    m_ScaleWithImpact

    If checked, signal amplitude scaling will also be applied to the time envelope of the signal. Bigger signals will last longer

    Declaration
    [Tooltip("If checked, signal amplitude scaling will also be applied to the time envelope of the signal.  Stronger signals will last longer.")]
    public bool m_ScaleWithImpact
    Field Value
    Type Description
    Boolean

    m_SustainTime

    Duration in seconds of the central fully-scaled part of the envelope. Must be >= 0.

    Declaration
    [Tooltip("Duration in seconds of the central fully-scaled part of the envelope.  Must be >= 0.")]
    public float m_SustainTime
    Field Value
    Type Description
    Single

    Properties

    Duration

    Duration of the envelope, in seconds. If negative, then duration is infinite.

    Declaration
    public float Duration { get; }
    Property Value
    Type Description
    Single

    Methods

    ChangeStopTime(Single, Boolean)

    Change the envelope so that it stops at a specific offset from its start time. Use this to extend or cut short an existing envelope, while respecting the attack and decay as much as possible.

    Declaration
    public void ChangeStopTime(float offset, bool forceNoDecay)
    Parameters
    Type Name Description
    Single offset

    When to stop the envelope

    Boolean forceNoDecay

    If true, enevlope will not decay, but cut off instantly

    Clear()

    Set the envelop times to 0 and the shapes to default.

    Declaration
    public void Clear()

    Default()

    Get an envelope with default values.

    Declaration
    public static CinemachineImpulseManager.EnvelopeDefinition Default()
    Returns
    Type Description
    CinemachineImpulseManager.EnvelopeDefinition

    GetValueAt(Single)

    Get the value of the tenvelope at a given time relative to the envelope start.

    Declaration
    public float GetValueAt(float offset)
    Parameters
    Type Name Description
    Single offset

    Time in seconds fromt he envelope start

    Returns
    Type Description
    Single

    Envelope amplitude. This will range from 0...1

    Validate()

    Call from OnValidate to ensure that envelope values are sane

    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