Skip to main content

Recording Events API

This API allows you set events to be trigger during specific points during recording, but these events will only trigger during replay (not during capture).

You can assign your events on any script inside of Start, the API handles when to trigger the events automatically.


using Luna.Replay.Api;
public class ExampleClass : MonoBehaviour {

private void Start() {
// Log "Started!" upon the replay beginning
Recording.Start += () => Debug.Log( "Started!" );

// Log "Complete!" when the replay ends
Recording.Complete += () => Debug.Log( "Complete!" );

// Disable a text object when there are 2 seconds remaining in the replay
Recording.InvokeBeforeEnd( () => UI_Text.SetActive(false), 2);;

// Enable a button when 5 seconds have passed from the beginning of the replay
Recording.InvokeAfterStart(() => UI_Button.SetActive(true), 5);