Class PulseVibrationEffect
Dual-motor gamepad vibration that pulses at an authored frequency and duty cycle instead of holding a
flat buzz — e.g. matched to an automatic weapon's fire rate. Expands into a
FeedbackPatternStep sequence via FeedbackPulseExpander (Steps),
which the Unity FeedbackPatternPlayer walks in real time.
Inherited Members
Namespace: Serenity.Feedback.Application.Effects
Assembly: Serenity.Feedback.Application.dll
Syntax
public sealed class PulseVibrationEffect : IFeedbackEffect, IFeedbackPattern
Remarks
TotalDurationSeconds is always the length of one playthrough of the expanded
Steps sequence — for a fire-rate match this is typically a single period
(1 / FrequencyHertz). HaveExitTime then decides what happens once that
playthrough ends, mirroring VibrationEffect's semantics: true auto-stops after
the one playthrough (a timed burst of pulses); false loops the same sequence back-to-back
indefinitely — the continuous pulsing sustained automatic fire needs — until something else calls
Stop.
Constructors
PulseVibrationEffect(FeedbackIntensity, float, float, float, bool)
Initializes a new instance from a peak FeedbackIntensity.
Declaration
public PulseVibrationEffect(FeedbackIntensity peakIntensity, float frequencyHertz, float dutyCycle, float totalDurationSeconds, bool haveExitTime = true)
Parameters
| Type | Name | Description |
|---|---|---|
| FeedbackIntensity | peakIntensity | Peak low/high motor amplitudes each pulse reaches. |
| float | frequencyHertz | Pulses per second. |
| float | dutyCycle | Fraction of each period the motor is on, in (0, 1]. |
| float | totalDurationSeconds | Length of one playthrough of the pattern, in seconds. |
| bool | haveExitTime | Whether the channel auto-stops after one playthrough (see remarks). |
PulseVibrationEffect(float, float, float, float, float, bool)
Initializes a new instance from raw peak amplitudes.
Declaration
public PulseVibrationEffect(float low, float high, float frequencyHertz, float dutyCycle, float totalDurationSeconds, bool haveExitTime = true)
Parameters
| Type | Name | Description |
|---|---|---|
| float | low | |
| float | high | |
| float | frequencyHertz | |
| float | dutyCycle | |
| float | totalDurationSeconds | |
| bool | haveExitTime |
Fields
DutyCycle
Declaration
public readonly float DutyCycle
Field Value
| Type | Description |
|---|---|
| float | Fraction of each period the motor is on, in (0, 1]. |
FrequencyHertz
Declaration
public readonly float FrequencyHertz
Field Value
| Type | Description |
|---|---|
| float | Pulses per second. At or below zero, the pattern collapses to a single continuous step. |
HaveExitTime
Declaration
public readonly bool HaveExitTime
Field Value
| Type | Description |
|---|---|
| bool | When true the channel auto-stops after one playthrough of the pattern; when false the
pattern loops indefinitely until |
Intensity
Declaration
public readonly FeedbackIntensity Intensity
Field Value
| Type | Description |
|---|---|
| FeedbackIntensity | Peak low/high motor amplitudes each pulse reaches. |
Kind
Declaration
public const string Kind = "vibration-pulse"
Field Value
| Type | Description |
|---|---|
| string | Stable kind id for this effect. |
TotalDurationSeconds
Declaration
public readonly float TotalDurationSeconds
Field Value
| Type | Description |
|---|---|
| float | Length, in seconds, of one playthrough of the expanded pattern. See the remarks on HaveExitTime for how this combines with looping. |
Properties
BypassesGlobalGate
Declaration
public bool BypassesGlobalGate { get; }
Property Value
| Type | Description |
|---|---|
| bool | When true, this effect ignores the global vibration enable/intensity settings — it is dispatched even when feedback is disabled and is never passed through Scaled(float). Reserved for non-haptic effects (e.g. audio) that must not be silenced or attenuated by the controller-vibration toggle. Haptic effects return false. |
EffectKind
Declaration
public string EffectKind { get; }
Property Value
| Type | Description |
|---|---|
| string | Stable identifier of the effect type (e.g. "vibration"). Used for logging/diagnostics. |
Steps
Declaration
public IReadOnlyList<FeedbackPatternStep> Steps { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<FeedbackPatternStep> |
Methods
Scaled(float)
Returns a copy of this effect scaled by the global intensity multiplier (0..1).
Declaration
public IFeedbackEffect Scaled(float globalIntensity)
Parameters
| Type | Name | Description |
|---|---|---|
| float | globalIntensity | Global multiplier; values outside 0..1 are clamped by the effect. |
Returns
| Type | Description |
|---|---|
| IFeedbackEffect | A new, scaled effect of the same type. |