Description
LckOnScreenUIController is a Unity MonoBehaviour that controls the visibility and visual state of on-screen UI elements (Photo Mode, Selfie Mode buttons, etc.) during notifications and recording. It disables buttons while notifications are active and resets them to their default state when notifications end, preventing user interaction during transient UI states.
It works alongside LckNotificationController, which calls OnNotificationStarted() and OnNotificationEnded() to lock/unlock UI automatically.
Usage
UseLckOnScreenUIController to keep your on-screen buttons in sync with notification and recording state. Add it to a GameObject, populate the on-screen UI list in the Inspector, and connect it to your LckNotificationController.
Notification flow
References
Properties
| Property | Type | Description |
|---|---|---|
| _lckService | ILckService | Injected LCK service used to subscribe to recording events. |
| _allOnscreenUI | List<GameObject> | List of UI elements controlled by this manager. |
Methods
| Method | Returns | Description |
|---|---|---|
| OnNotificationStarted() | void | Disables all UI elements when a notification appears. |
| OnNotificationEnded() | void | Re-enables all UI elements and resets their visuals to default. |
| OnRecordingStarted(LckResult result) | void | Event handler: ensures UI is enabled when recording begins successfully. |
| SetAllOnscreenButtonsState(bool state) | void | Enables or disables all tracked UI GameObjects. |
| SetAllOnscreenButtonsToDefaultVisual(List<GameObject> objectList) | void | Resets UI button visuals by calling SetDefaultButtonColors() on each LckScreenButton. |
See Also
- LckNotificationController — Triggers OnNotificationStarted/OnNotificationEnded on this controller
- ILckService — Service interface providing recording events
- LckResult — Result type passed to OnRecordingStarted