Class UnityUiPrimaryControllerManager
Unity component that manages UI controller routing policies based on game session mode.
Applies different routing strategies for SinglePlayer (all devices) vs LocalMultiplayer (primary device only).
Optionally auto-selects primary device at startup and provides dynamic policy application based on configuration.
Implements
Namespace: Serenity.InputGateway.Infrastructure.Components
Assembly: Serenity.UnityPlayerInput.Infrastructure.dll
Syntax
public class UnityUiPrimaryControllerManager : MonoBehaviour, IUiPrimaryControllerManager
Constructors
UnityUiPrimaryControllerManager()
Declaration
public UnityUiPrimaryControllerManager()
Properties
PrimaryDeviceId
Declaration
public string PrimaryDeviceId { get; }
Property Value
| Type | Description |
|---|---|
| string | Gets the ID of the currently selected primary input device. |
Methods
ApplyUiPolicy()
Applies the appropriate UI routing policy based on current game session mode and configuration settings.
Routes to primary-only for LocalMultiplayer mode, and all devices for SinglePlayer (unless configured otherwise).
Provides fallback routing strategies when primary device is not yet established.
Declaration
public void ApplyUiPolicy()
Initialize(ILogService)
Initializes the UI primary controller manager with a logging service.
Declaration
public void Initialize(ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogService | logService | The logging service for diagnostic output. |
SetPrimaryDevice(string)
Sets the primary input device and immediately reapplies the UI routing policy.
Used after primary device selection to update routing configuration accordingly.
Declaration
public void SetPrimaryDevice(string deviceId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | deviceId | The device ID of the new primary input device. |