Class AdaptiveTriggerBackendRegistry
Registration point for a game-supplied IAdaptiveTriggerBackend.
Inherited Members
Namespace: Serenity.Feedback.Infrastructure.AdaptiveTrigger
Assembly: Serenity.UnityFeedback.Infrastructure.dll
Syntax
public static class AdaptiveTriggerBackendRegistry
Remarks
Adaptive triggers on a licensed console are driven through a platform SDK whose headers cannot
ship inside Serenity. Without this seam the only way to reach that SDK would be editing
UnityFeedbackInstaller directly, and the next package update would overwrite the edit. A
factory registered here is consulted before the built-in platform selection, so a licensee
owns their backend in their own assembly and keeps it across updates.
Register before the feedback module installs — a [RuntimeInitializeOnLoadMethod] with
RuntimeInitializeLoadType.BeforeSceneLoad is the usual place. Registering later has no effect
on an already-installed module.
Properties
HasFactory
Declaration
public static bool HasFactory { get; }
Property Value
| Type | Description |
|---|---|
| bool | True when a factory has been registered, whether or not it produces a usable backend. |
Methods
ClearFactory()
Clears any registered factory, restoring the built-in platform selection.
Declaration
public static void ClearFactory()
SetFactory(Func<IAdaptiveTriggerBackend>)
Registers the factory consulted before the built-in platform backend selection.
Declaration
public static void SetFactory(Func<IAdaptiveTriggerBackend> factory)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IAdaptiveTriggerBackend> | factory | Creates the backend. Pass null to clear a previous registration. |
TryCreate(ILogService, out IAdaptiveTriggerBackend)
Creates the registered backend, if any.
Declaration
public static bool TryCreate(ILogService logService, out IAdaptiveTriggerBackend backend)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogService | logService | Receives a warning when a registered factory fails. Optional. |
| IAdaptiveTriggerBackend | backend | The created backend, or null when none is available. |
Returns
| Type | Description |
|---|---|
| bool | True when a registered factory produced a usable backend. |
Remarks
A factory that throws or returns null is reported and treated as absent rather than propagated: a broken override degrades to the built-in backend instead of failing the whole feedback install.