Description
LckOnScreenUIController is a Unity MonoBehaviour that manages the visibility and visual state of on-screen UI elements in LCK.
It ensures that interactive elements like buttons (Photo Mode, Selfie Mode, etc.) behave correctly when:
- Notifications are shown/hidden
- Recording sessions start
- Notifications complete and the UI should reset to its default state
LckNotificationController, which calls OnNotificationStarted() and OnNotificationEnded() to temporarily disable UI interactions while notifications are active.
Usage
- Add
LckOnScreenUIControllerto a GameObject in your scene. - Populate the On-Screen UI list in the Inspector with all UI GameObjects you want to manage.
- Connect it with your
LckNotificationControllerso notifications correctly lock/unlock UI.
Example: Notification Flow
Example: Auto-reset Button Colors
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. |