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.
Description
LckMonitor is a Unity MonoBehaviour implementing ILckMonitor that acts as a display surface for LCK camera output. It auto-registers with the LCK system on enable, provides a RenderTexture output from connected LckCamera instances, and raises an event whenever a new texture is assigned — so you can pipe the capture preview onto any in-game screen, UI element, or 3D mesh.
Usage
Use LckMonitor when you need to show the camera preview in your scene. Add it to a GameObject, then subscribe to OnRenderTextureSet to apply the texture wherever you need it.
using Liv.Lck;
using UnityEngine;
public class MonitorExample : MonoBehaviour
{
[SerializeField] private Renderer _screenRenderer;
[SerializeField] private LckMonitor _lckMonitor;
private void OnEnable()
{
_lckMonitor.OnRenderTextureSet += HandleRenderTextureSet;
}
private void OnDisable()
{
_lckMonitor.OnRenderTextureSet -= HandleRenderTextureSet;
}
private void HandleRenderTextureSet(RenderTexture rt)
{
// Apply the LCK render texture to a material on a screen mesh
_screenRenderer.material.mainTexture = rt;
}
}
References
Fields
| Field | Type | Description |
|---|
| _monitorId | string | Unique identifier for this monitor instance. |
Properties
| Property | Type | Description |
|---|
| MonitorId | string | The unique identifier for this monitor. |
Events
| Event | Type | Description |
|---|
| OnRenderTextureSet | LckMonitorRenderTextureSetDelegate(RenderTexture renderTexture) | Invoked whenever a new RenderTexture is assigned to this monitor. |
Methods
| Method | Returns | Description |
|---|
| SetRenderTexture(RenderTexture) | void | Assigns a new RenderTexture to the monitor and triggers the event. |
See Also
- LckCamera — Camera component that outputs to monitors
- LckMediator — Static registry where monitors are auto-registered