logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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
    object
    VibrationChannel
    Implements
    IFeedbackChannel
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Feedback.Infrastructure.Channels
    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
    Type Description
    string

    Methods

    CanPlay(IFeedbackEffect)

    Declaration
    public bool CanPlay(IFeedbackEffect effect)
    Parameters
    Type Name Description
    IFeedbackEffect effect
    Returns
    Type Description
    bool

    Play(FeedbackTarget, IFeedbackEffect)

    Declaration
    public void Play(FeedbackTarget target, IFeedbackEffect effect)
    Parameters
    Type Name Description
    FeedbackTarget target
    IFeedbackEffect effect

    Stop(FeedbackTarget)

    Declaration
    public void Stop(FeedbackTarget target)
    Parameters
    Type Name Description
    FeedbackTarget target

    StopAll()

    Declaration
    public void StopAll()

    Implements

    IFeedbackChannel
    In this article
    © 2026 Serenity. All Rights Reserved