> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liv.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# LckOnScreenUIController

> How to manage on-screen button visibility and state during notifications and recording in Unity VR apps using the LIV Camera Kit (LCK) SDK.

## 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

Use `LckOnScreenUIController` 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

```c# theme={null}
// Called when a notification is shown — disables all UI
_onScreenUIController.OnNotificationStarted();

// Called when a notification ends — re-enables UI and resets button visuals
_onScreenUIController.OnNotificationEnded();
```

***

## References

### Properties

| Property            | Type                                                  | Description                                                 |
| :------------------ | :---------------------------------------------------- | :---------------------------------------------------------- |
| **\_lckService**    | [`ILckService`](/api-reference/interface/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)**](/api-reference/class/LckResult) | `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](/api-reference/unity/classes/LckNotificationController) — Triggers OnNotificationStarted/OnNotificationEnded on this controller
* [ILckService](/api-reference/unity/interfaces/ILckService) — Service interface providing recording events
* [LckResult](/api-reference/unity/classes/LckResult) — Result type passed to OnRecordingStarted
