docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct CinemachineImpulseManager.EnvelopeDefinition

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

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Cinemachine
    Assembly: Unity.Cinemachine.dll
    Syntax
    [Serializable]
    public struct CinemachineImpulseManager.EnvelopeDefinition

    Fields

    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")]
    [FormerlySerializedAs("m_AttackShape")]
    public AnimationCurve AttackShape
    Field Value
    Type Description
    AnimationCurve

    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.")]
    [FormerlySerializedAs("m_AttackTime")]
    public float AttackTime
    Field Value
    Type Description
    float

    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")]
    [FormerlySerializedAs("m_DecayShape")]
    public AnimationCurve DecayShape
    Field Value
    Type Description
    AnimationCurve

    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.")]
    [FormerlySerializedAs("m_DecayTime")]
    public float DecayTime
    Field Value
    Type Description
    float

    HoldForever

    If true, then duration is infinite.

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

    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.")]
    [FormerlySerializedAs("m_ScaleWithImpact")]
    public bool ScaleWithImpact
    Field Value
    Type Description
    bool

    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.")]
    [FormerlySerializedAs("m_SustainTime")]
    public float SustainTime
    Field Value
    Type Description
    float

    Properties

    Default

    Get an envelope with default values.

    Declaration
    public static CinemachineImpulseManager.EnvelopeDefinition Default { get; }
    Property Value
    Type Description
    CinemachineImpulseManager.EnvelopeDefinition

    An event with default values

    Duration

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

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

    Methods

    ChangeStopTime(float, bool)

    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
    float offset

    When to stop the envelope

    bool forceNoDecay

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

    Clear()

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

    Declaration
    public void Clear()

    GetValueAt(float)

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

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

    Time in seconds from the envelope start

    Returns
    Type Description
    float

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

    Validate()

    Call from OnValidate to ensure that envelope values are sane

    Declaration
    public void Validate()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)