logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityFeedbackService

    Unity MonoBehaviour implementation of IFeedbackService and IFeedbackRuntime. Routes each effect of a definition to every channel that can play it, and owns the single global stop/lifecycle safety net (application focus/pause, scene unload, play-mode exit, disable/destroy, and the vibration-disabled setting). Per-effect timing/restoration is owned by each channel via the coroutine host this class exposes through IFeedbackRuntime.

    Inheritance
    object
    UnityFeedbackService
    Implements
    IFeedbackService
    IFeedbackRuntime
    IFoundationSettings
    Namespace: Serenity.Feedback.Infrastructure.Services
    Assembly: Serenity.UnityFeedback.Infrastructure.dll
    Syntax
    public class UnityFeedbackService : MonoBehaviour, IFeedbackService, IFeedbackRuntime, IFoundationSettings

    Constructors

    UnityFeedbackService()

    Declaration
    public UnityFeedbackService()

    Fields

    Guid

    Declaration
    public string Guid
    Field Value
    Type Description
    string

    GUID for this service instance.

    Id

    Declaration
    public string Id
    Field Value
    Type Description
    string

    Unique identifier for this service instance.

    Properties

    IsEnabled

    Declaration
    public bool IsEnabled { get; }
    Property Value
    Type Description
    bool

    MenuSubmitDefinitionId

    Declaration
    public string MenuSubmitDefinitionId { get; }
    Property Value
    Type Description
    string

    MenuTickDefinitionId

    Declaration
    public string MenuTickDefinitionId { get; }
    Property Value
    Type Description
    string

    Methods

    Cancel(object)

    Declaration
    public void Cancel(object handle)
    Parameters
    Type Name Description
    object handle

    Initialize(IGameSettingsService, IFeedbackSettings, IFeedbackDefinitionProvider, List<IFeedbackChannel>, IEventDispatcherService, ILogService)

    Initializes the service with all required dependencies. Called by the installer after the service exists and the channels (which take this instance as their IFeedbackRuntime) have been constructed.

    Declaration
    public void Initialize(IGameSettingsService gameSettingsService, IFeedbackSettings settings, IFeedbackDefinitionProvider definitionProvider, List<IFeedbackChannel> channels, IEventDispatcherService eventDispatcherService, ILogService logService)
    Parameters
    Type Name Description
    IGameSettingsService gameSettingsService
    IFeedbackSettings settings
    IFeedbackDefinitionProvider definitionProvider
    List<IFeedbackChannel> channels
    IEventDispatcherService eventDispatcherService
    ILogService logService

    Play(FeedbackDefinitionData)

    Declaration
    public void Play(FeedbackDefinitionData definition)
    Parameters
    Type Name Description
    FeedbackDefinitionData definition

    Play(string)

    Declaration
    public void Play(string definitionId)
    Parameters
    Type Name Description
    string definitionId

    PlayForDevice(string, FeedbackDefinitionData)

    Declaration
    public void PlayForDevice(string deviceId, FeedbackDefinitionData definition)
    Parameters
    Type Name Description
    string deviceId
    FeedbackDefinitionData definition

    PlayForDevice(string, string)

    Declaration
    public void PlayForDevice(string deviceId, string definitionId)
    Parameters
    Type Name Description
    string deviceId
    string definitionId

    PlayForPlayer(int, FeedbackDefinitionData)

    Declaration
    public void PlayForPlayer(int playerIndex, FeedbackDefinitionData definition)
    Parameters
    Type Name Description
    int playerIndex
    FeedbackDefinitionData definition

    PlayForPlayer(int, string)

    Declaration
    public void PlayForPlayer(int playerIndex, string definitionId)
    Parameters
    Type Name Description
    int playerIndex
    string definitionId

    PlayForPlayerInput(object, FeedbackDefinitionData)

    Declaration
    public void PlayForPlayerInput(object playerInput, FeedbackDefinitionData definition)
    Parameters
    Type Name Description
    object playerInput
    FeedbackDefinitionData definition

    PlayForPlayerInput(object, string)

    Declaration
    public void PlayForPlayerInput(object playerInput, string definitionId)
    Parameters
    Type Name Description
    object playerInput
    string definitionId

    Run(IEnumerator, object)

    Declaration
    public void Run(IEnumerator routine, object handle)
    Parameters
    Type Name Description
    IEnumerator routine
    object handle

    SetGlobalEnabled(bool)

    Declaration
    public void SetGlobalEnabled(bool enabled)
    Parameters
    Type Name Description
    bool enabled

    SetGlobalIntensity(float)

    Declaration
    public void SetGlobalIntensity(float intensity01)
    Parameters
    Type Name Description
    float intensity01

    StopAll()

    Declaration
    public void StopAll()

    Implements

    IFeedbackService
    IFeedbackRuntime
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved