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
UnityFeedbackService
Assembly: Serenity.UnityFeedback.Infrastructure.dll
Syntax
public class UnityFeedbackService : MonoBehaviour, IFeedbackService, IFeedbackRuntime, IFoundationSettings
Constructors
UnityFeedbackService()
Declaration
public UnityFeedbackService()
Fields
Guid
Declaration
Field Value
| Type |
Description |
| string |
GUID for this service instance.
|
Id
Declaration
Field Value
| Type |
Description |
| string |
Unique identifier for this service instance.
|
Properties
IsEnabled
Declaration
public bool IsEnabled { get; }
Property Value
Declaration
public string MenuSubmitDefinitionId { get; }
Property Value
Declaration
public string MenuTickDefinitionId { get; }
Property Value
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
Play(FeedbackDefinitionData)
Declaration
public void Play(FeedbackDefinitionData definition)
Parameters
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
PlayForDevice(string, string)
Declaration
public void PlayForDevice(string deviceId, string definitionId)
Parameters
PlayForPlayer(int, FeedbackDefinitionData)
Declaration
public void PlayForPlayer(int playerIndex, FeedbackDefinitionData definition)
Parameters
PlayForPlayer(int, string)
Declaration
public void PlayForPlayer(int playerIndex, string definitionId)
Parameters
| Type |
Name |
Description |
| int |
playerIndex |
|
| string |
definitionId |
|
Declaration
public void PlayForPlayerInput(object playerInput, FeedbackDefinitionData definition)
Parameters
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
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
Implements