Skip to main content

Description

LckNotificationController is a Unity MonoBehaviour that handles user-facing notifications in LCK — things like “video saved”, “enter stream code”, or “configure streaming”. It instantiates notification prefabs mapped to NotificationType values, shows/hides them in response to service events, and provides a simple API for other controllers (like LckStreamingController) to trigger notifications from code. Attach this component to a GameObject and configure notification prefabs in the Inspector. Each prefab must contain a component inheriting from LckBaseNotification.

Usage

Use LckNotificationController to give users visual feedback during recording, streaming, and authentication flows.

Showing a saved video notification

_notificationController.ShowNotification(NotificationType.VideoSaved);

Displaying a login code

_notificationController.SetNotificationStreamCode("123-456");

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.

See Also