Components
This section is under development. Please join our Discord and make a post in the Developer section to ask for LCK support.
Core
These MonoBehaviours are the main ones you will need when using LCK.
They all connect the LckService
to Unity gameobjects to allow easy control over the capture behaviour.
LckServiceHelper
This script acts as a simple helper to get a baseline LckService
up and running, as well as tying the lifetime of the service to a GameObject. This means that if you need to keep the LckService
alive you need to keep the LckServiceHelper
gameobject alive during scene loads.
It takes in some video track configuration settings - like resolution, bitrate and framerate - which it generates an LckDescriptor
from, and then based on that descriptor creates an LckService
on Awake
, and also destroys the service OnDestroy
.
Track settings on the LckServiceHelper have no effect when using the LckTablet
, as the tablet will override track settings at runtime depending on platform
While this script is helpful when getting started, it is fairly rudimentary, so we recommend you create and manage the LCK Service
in your own logic if it needs a tigher integration with your game.
LckCamera
This is the component that connects regular Unity Camera
components with the LCK system.
Serialized Fields
- Camera _camera
Reference to the Unity Camera that should be managed. - string _cameraId
Optional field for setting the ID of the camera. If this is not set it will get an auto generated UUID. Setting this to "MyCamera" will allow you to talk to the service and pass in the camera ID "MyCamera".
Public Methods
- string CameraId
Gives you the Camera ID of the LCK Camera, allowing you to pass it to theLckService
. - GetCameraComponent
Gives you the underlying Unity Camera.
LckMonitor
This component gives you access to the current active capure RenderTexture, for displaying it or further processing it.
Serialized Fields
- string _monitorId
Optional field for setting the ID of the monitor. If this is not set it will get an auto generated UUID. Setting this to "MyMonitor" will allow you to talk to the service and pass in the monitor ID "MyMonitor".
Public Events
- LckMonitorRenderTextureSetDelegate OnRenderTextureSet This event is fired whenever LCK creates a new render texture for the main output. This allows you to monitor whatever render texture the currently active camera is rendering into.