Class CinemachineImpulseListener
An extension for CinemachineCamera which post-processes the final position of the camera. It listens for CinemachineImpulse signals on the specified channels, and moves the camera in response to them.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Extensions/Cinemachine Impulse Listener")]
[ExecuteAlways]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineImpulseListener.html")]
public class CinemachineImpulseListener : CinemachineExtension
Fields
ApplyAfter
When to apply the impulse reaction. Default is Noise. Modify this if necessary to influence the ordering of extension effects
Declaration
[Tooltip("When to apply the impulse reaction. Default is after the Noise stage. Modify this if necessary to influence the ordering of extension effects")]
[FormerlySerializedAs("m_ApplyAfter")]
public CinemachineCore.Stage ApplyAfter
Field Value
| Type | Description |
|---|---|
| CinemachineCore.Stage |
ChannelMask
Impulse events on channels not included in the mask will be ignored.
Declaration
[Tooltip("Impulse events on channels not included in the mask will be ignored.")]
[FormerlySerializedAs("m_ChannelMask")]
public int ChannelMask
Field Value
| Type | Description |
|---|---|
| int |
Gain
Gain to apply to the Impulse signal.
Declaration
[Tooltip("Gain to apply to the Impulse signal. 1 is normal strength. Setting this to 0 completely mutes the signal.")]
[FormerlySerializedAs("m_Gain")]
public float Gain
Field Value
| Type | Description |
|---|---|
| float |
ReactionSettings
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.
Declaration
[Tooltip("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.")]
[FormerlySerializedAs("m_ReactionSettings")]
public CinemachineImpulseListener.ImpulseReaction ReactionSettings
Field Value
| Type | Description |
|---|---|
| CinemachineImpulseListener.ImpulseReaction |
SignalCombinationMode
Specifies how the Impulse Listener combines multiple impulses active at the current point in space.
Declaration
[Tooltip("Controls how the Impulse Listener combines multiple impulses active at the current point in space.\n\n<b>Additive</b>: Combines all the active signals together, like sound waves. This is the default.\n\n<b>Use Largest</b>: Considers only the signal with the largest amplitude; ignores any others.")]
public CinemachineImpulseListener.SignalCombinationModes SignalCombinationMode
Field Value
| Type | Description |
|---|---|
| CinemachineImpulseListener.SignalCombinationModes |
Use2DDistance
Enable this to perform distance calculation in 2D (ignore Z).
Declaration
[Tooltip("Enable this to perform distance calculation in 2D (ignore Z)")]
[FormerlySerializedAs("m_Use2DDistance")]
public bool Use2DDistance
Field Value
| Type | Description |
|---|---|
| bool |
UseCameraSpace
Enable this to process all impulse signals in camera space.
Declaration
[Tooltip("Enable this to process all impulse signals in camera space")]
[FormerlySerializedAs("m_UseCameraSpace")]
public bool UseCameraSpace
Field Value
| Type | Description |
|---|---|
| bool |
Methods
PostPipelineStageCallback(CinemachineVirtualCameraBase, Stage, ref CameraState, float)
React to any detected impulses
Declaration
protected override void PostPipelineStageCallback(CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| CinemachineVirtualCameraBase | vcam | The virtual camera being processed |
| CinemachineCore.Stage | stage | The current pipeline stage |
| CameraState | state | The current virtual camera state |
| float | deltaTime | The current applicable deltaTime |