Class CinemachineImpulseDefinition
Definition of an impulse signal that gets propagated to listeners.
Here you provide a Raw Signal source, and define an envelope for time-scaling it to craft the complete Impulse signal shape. Also, you provide here parameters that define how the signal dissipates with spatial distance from the source location. Finally, you specify the Impulse Channel on which the signal will be sent.
An API method is provided here to take these parameters, create an Impulse Event, and broadcast it on the channel.
When creating a custom Impulse Source class, you will have an instance of this class as a field in your custom class. Be sure also to include the [CinemachineImpulseDefinition] attribute on the field, to get the right property drawer for it.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: solution.dll
Syntax
[Serializable]
public class CinemachineImpulseDefinition
Fields
Name | Description |
---|---|
AmplitudeGain | Legacy mode only: Gain to apply to the amplitudes defined in the signal source asset. |
CustomImpulseShape | A user-defined impulse shape, used only if m_ImpulseShape is Custom. Defines the signal that will be generated. X axis must go from 0...1, and Y axis is the scale that will be applied to the impact velocity. |
DirectionMode | Legacy mode only: How the signal direction behaves as the listener moves away from the origin. |
DissipationDistance | The signal will have no effect outside this radius surrounding the impact point. |
DissipationMode | Legacy mode only: This defines how the signal will dissipate with distance beyond the impact radius. |
DissipationRate | This defines how the widely signal will spread within the effect radius before dissipating with distance from the impact point |
FrequencyGain | Legacy mode only: Scale factor to apply to the time axis. |
ImpactRadius | Legacy mode only: The signal will have full amplitude in this radius surrounding the impact point. |
ImpulseChannel | Impulse events generated here will appear on the channels included in the mask. |
ImpulseDuration | The time during which the impact signal will occur. |
ImpulseShape | The shape of the impact signal. |
ImpulseType | How the impulse travels through space and time. |
PropagationSpeed | The speed (m/s) at which the impulse propagates through space. High speeds allow listeners to react instantaneously, while slower speeds allow listeners in the scene to react as if to a wave spreading from the source. |
Randomize | Legacy mode only: Randomize the signal start time |
RawSignal | Legacy mode only: Defines the signal that will be generated. |
RepeatMode | Legacy mode only: How to fit the signal into the envelope time |
TimeEnvelope | Legacy mode only: This defines the time-envelope of the signal. |
Methods
Name | Description |
---|---|
CreateAndReturnEvent(Vector3, Vector3) | Generate an impulse event at a location in space, and broadcast it on the appropriate impulse channel |
CreateEvent(Vector3, Vector3) | Generate an impulse event at a location in space, and broadcast it on the appropriate impulse channel |
OnValidate() | Call this from your behaviour's OnValidate to validate the fields here |