Skip to main content

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

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

PropertyTypeDescription
_lckServiceILckServiceInjected LCK service used to subscribe to recording events.
_allOnscreenUIList<GameObject>List of UI elements controlled by this manager.

Methods

MethodReturnsDescription
OnNotificationStarted()voidDisables all UI elements when a notification appears.
OnNotificationEnded()voidRe-enables all UI elements and resets their visuals to default.
OnRecordingStarted(LckResult result)voidEvent handler: ensures UI is enabled when recording begins successfully.
SetAllOnscreenButtonsState(bool state)voidEnables or disables all tracked UI GameObjects.
SetAllOnscreenButtonsToDefaultVisual(List<GameObject> objectList)voidResets UI button visuals by calling SetDefaultButtonColors() on each LckScreenButton.

See Also