Skip to main content

Description

LckNotificationController is a Unity MonoBehaviour that manages notifications in the LIV Capture Kit (LCK). It is responsible for:
  • Instantiating and managing notification prefabs
  • Displaying notifications in response to LCK service events (e.g., video saved, streaming started)
  • Providing a central API for other controllers (like LckStreamingController) to show or hide notifications
Attach this component to a GameObject and configure notification prefabs in the Unity Inspector. Each prefab is linked to a NotificationType and must contain a component inheriting from LckBaseNotification.

Usage

  1. Add LckNotificationController to a GameObject in your scene.
  2. Configure the notifications list in the Inspector by assigning prefabs for each NotificationType.
  3. Link a LckOnScreenUIController to respond when notifications appear/disappear.
  4. Use ShowNotification(NotificationType) and HideNotifications() in your code or UI flows.

Example: Showing a Saved Video Notification

_notificationController.ShowNotification(NotificationType.VideoSaved);

Example: Displaying a Login Code

_notificationController.SetNotificationStreamCode("123-456");

Example: Clearing All Notifications

_notificationController.HideNotifications();

References

NotificationType

ValueDescription
VideoSavedShown when a recording has been saved successfully.
PhotoSavedShown when a photo capture is saved successfully.
EnterStreamCodeShown to display the LIV Hub login/stream code.
CheckSubscribedShown to prompt the user to verify or upgrade their subscription.
ConfigureStreamShown to prompt the user to configure their streaming setup in LIV Hub.
InternalErrorShown when an error occurs during the streaming setup process.

Properties

PropertyTypeDescription
_notificationsInitializerList<InitializerNotification>Inspector-configured list mapping NotificationType to prefabs.
_notificationsDictionary<NotificationType, LckBaseNotification>Runtime dictionary of instantiated notifications.
_currentNotificationLckBaseNotificationReference to the currently active notification (if any).
_notificationShowDurationfloatDefault duration in seconds before auto-hiding a notification.
_notificationsTransformTransformParent transform where notification prefabs are instantiated.
_onScreenUIControllerLckOnScreenUIControllerOptional higher-level UI controller that reacts to notification lifecycle events.

Methods

MethodReturnsDescription
ShowNotification(NotificationType type)voidDisplays a notification of the given type. Hides any currently visible notification first.
HideNotifications()voidImmediately hides any active notification and stops pending auto-hide timers.
SetNotificationStreamCode(string code)voidUpdates the EnterStreamCode notification with a login code.
InitializeNotifications()voidInstantiates all configured notification prefabs at startup. Called in Awake().
DestroyNotifications()voidDestroys all instantiated notification prefabs for cleanup.
I