Class VibrationChannel
Feedback channel that drives gamepad vibration motors. Handles VibrationEffect. Owns its
own duration auto-stop: motors are set on Play and cleared after the effect duration via the shared
IFeedbackRuntime (realtime, so a paused game still stops the buzz). Hardware routing goes
through the registered IGamepadOutputBackend list (DualShock 4 / DualSense / Switch Pro
and any future controller); the first backend that claims the pad wins, otherwise the standard Unity
motor API is used. The service's global StopAll funnels into StopAll().
Inheritance
VibrationChannel
Assembly: Serenity.UnityFeedback.Infrastructure.dll
Syntax
public class VibrationChannel : IFeedbackChannel
Constructors
VibrationChannel(UnityGamepadTargetResolver, IFeedbackRuntime, IReadOnlyList<IGamepadOutputBackend>)
Initializes a new VibrationChannel.
Declaration
public VibrationChannel(UnityGamepadTargetResolver resolver, IFeedbackRuntime runtime, IReadOnlyList<IGamepadOutputBackend> backends)
Parameters
| Type |
Name |
Description |
| UnityGamepadTargetResolver |
resolver |
Resolves a FeedbackTarget to a concrete Gamepad.
|
| IFeedbackRuntime |
runtime |
Coroutine host used to schedule the per-device auto-stop.
|
| IReadOnlyList<IGamepadOutputBackend> |
backends |
Ordered output backends tried before the Gamepad.SetMotorSpeeds fallback.
The first backend that claims the pad handles it; if none do, Unity's standard motor API is used.
|
Properties
ChannelId
Declaration
public string ChannelId { get; }
Property Value
Methods
CanPlay(IFeedbackEffect)
Declaration
public bool CanPlay(IFeedbackEffect effect)
Parameters
Returns
Play(FeedbackTarget, IFeedbackEffect)
Declaration
public void Play(FeedbackTarget target, IFeedbackEffect effect)
Parameters
Stop(FeedbackTarget)
Declaration
public void Stop(FeedbackTarget target)
Parameters
StopAll()
Declaration
Implements