Skip to main content

Scripting API

The Daydream Unity plugin exposes a C# API for scripting, automation, and building custom interactions.

Accessing the Component

State Machine

The component follows a simple state machine:

States

Output Texture

Access the AI-transformed video as a Texture for use on any surface:
Set showOverlay = false to disable the built-in fullscreen overlay when you want to render the AI output on custom surfaces like 3D objects or UI elements.

Changing Prompts at Runtime

Parameters are synced to the server every 100ms via debounced PATCH requests. You can also modify any public field directly:

Inspector Fields

All fields on the Daydream component are public and can be modified from scripts:

Types

ControlNetConfig

IPAdapterConfig

PromptEntry / SeedEntry

Example: Audio-Reactive Effects

Modulate AI parameters based on audio analysis:

Example: Prompt Cycling

Cycle through prompts on a timer:

Example: Render to 3D Surface

Apply AI output to a 3D object instead of the screen overlay:

Next Steps