Interface IFeedbackService
The single caller-facing entry point for feedback. Gameplay code, menu navigation, and the
PlayFeedbackSignal bridge all go through this one service, so global enable/intensity
scaling lives in exactly one place. Targeting is multiplayer-aware: callers can address the
acting pad, a specific player, a specific PlayerInput, or a specific device.
Namespace: Serenity.Feedback.Application.Interfaces
Assembly: Serenity.Feedback.Application.dll
Syntax
public interface IFeedbackService : IService, IFoundationSettings
Properties
IsEnabled
Declaration
bool IsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether feedback is currently enabled. |
MenuSubmitDefinitionId
Declaration
string MenuSubmitDefinitionId { get; }
Property Value
| Type | Description |
|---|---|
| string | Configured default definition id played when a menu option is submitted. Empty when no feedback settings asset configures one. |
MenuTickDefinitionId
Declaration
string MenuTickDefinitionId { get; }
Property Value
| Type | Description |
|---|---|
| string | Configured default definition id played when a menu selection changes. Empty when no feedback settings asset configures one (menus then stay silent on navigation). |
Methods
Play(FeedbackDefinitionData)
Plays an already-resolved definition on the acting pad.
Declaration
void Play(FeedbackDefinitionData definition)
Parameters
| Type | Name | Description |
|---|---|---|
| FeedbackDefinitionData | definition | The feedback definition data. |
Play(string)
Plays a definition on the pad that most recently acted (single-player convenience).
Declaration
void Play(string definitionId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | definitionId | The feedback definition id. |
PlayForDevice(string, FeedbackDefinitionData)
Plays an already-resolved definition on a specific input device.
Declaration
void PlayForDevice(string deviceId, FeedbackDefinitionData definition)
Parameters
| Type | Name | Description |
|---|---|---|
| string | deviceId | The input device id. |
| FeedbackDefinitionData | definition | The feedback definition data. |
PlayForDevice(string, string)
Plays a definition on a specific input device.
Declaration
void PlayForDevice(string deviceId, string definitionId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | deviceId | The input device id. |
| string | definitionId | The feedback definition id. |
PlayForPlayer(int, FeedbackDefinitionData)
Plays an already-resolved definition on a specific joined player's pad.
Declaration
void PlayForPlayer(int playerIndex, FeedbackDefinitionData definition)
Parameters
| Type | Name | Description |
|---|---|---|
| int | playerIndex | Zero-based player index. |
| FeedbackDefinitionData | definition | The feedback definition data. |
PlayForPlayer(int, string)
Plays a definition on a specific joined player's pad.
Declaration
void PlayForPlayer(int playerIndex, string definitionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | playerIndex | Zero-based player index. |
| string | definitionId | The feedback definition id. |
PlayForPlayerInput(object, FeedbackDefinitionData)
Plays an already-resolved definition on the pad driving the given PlayerInput.
Declaration
void PlayForPlayerInput(object playerInput, FeedbackDefinitionData definition)
Parameters
| Type | Name | Description |
|---|---|---|
| object | playerInput | A |
| FeedbackDefinitionData | definition | The feedback definition data. |
PlayForPlayerInput(object, string)
Plays a definition on the pad driving the given PlayerInput. The parameter is typed
object so this Application contract stays free of the Input System dependency;
the infrastructure implementation casts it to UnityEngine.InputSystem.PlayerInput.
Declaration
void PlayForPlayerInput(object playerInput, string definitionId)
Parameters
| Type | Name | Description |
|---|---|---|
| object | playerInput | A |
| string | definitionId | The feedback definition id. |
SetGlobalEnabled(bool)
Sets the global enable switch. Disabling immediately stops active output.
Declaration
void SetGlobalEnabled(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | Whether feedback is enabled. |
SetGlobalIntensity(float)
Sets the global intensity multiplier applied to every impulse.
Declaration
void SetGlobalIntensity(float intensity01)
Parameters
| Type | Name | Description |
|---|---|---|
| float | intensity01 | Intensity in the 0..1 range; values outside are clamped. |
StopAll()
Stops all feedback output across every channel and pad.
Declaration
void StopAll()