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
Typically, this controller works alongside LckNotificationController, which calls OnNotificationStarted() and OnNotificationEnded() to temporarily disable UI interactions while notifications are active.

Usage

  1. Add LckOnScreenUIController to a GameObject in your scene.
  2. Populate the On-Screen UI list in the Inspector with all UI GameObjects you want to manage.
  3. Connect it with your LckNotificationController so notifications correctly lock/unlock UI.

Example: Notification Flow

// Called when a notification is shown
_onScreenUIController.OnNotificationStarted();

// Called when a notification ends
_onScreenUIController.OnNotificationEnded();

Example: Auto-reset Button Colors

_onScreenUIController.OnNotificationEnded();
// Resets all UI buttons back to their default visual state

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.