Documentation

Set up the project-owned overlay, connect Unity and React, use Live Twin, and prepare production or player UI updates.

Open the starter and press Play.

First import creates a small project-owned starter, editable React source, and matching built overlay. ReLayer Studio opens after successful setup.

  1. 1

    Open Starter Scene

    Open Tools/ReLayer/Open Studio, then choose Open Starter Scene. Your scene remains yours.

  2. 2

    Press Play

    The default Auto source starts managed Vite development and HMR for the project-owned template.

  3. 3

    Edit the app

    Change Assets/ReLayerUser/Overlay/Template/src/App.tsx and src/styles.css.

  4. 4

    Build normally

    Unity player builds refresh the production overlay before writing the player.

Toolchain

Unity 2022.3 LTS and Unity 6 are supported; this release's WebGL browser validation is limited to Unity 2022.3.62f2 with desktop Chrome and Edge. Node.js is needed only when editing or rebuilding the overlay: use Node.js ^20.19.0 or ≥22.12.0. Node.js 21 and 22.0–22.11 do not meet the packaged Vite runtime contract.

A React workspace, built with ReLayer.

Open Tools > ReLayer > Open Studio. Choose a delivery mode, enter its required values, then validate and build. The interface shares this website's branding, while Unity owns your settings and operations.

Overview

Current readiness, active delivery mode, and your next useful action.

UI Delivery

Bundled, Addressables, Hosted, Local, and Custom settings with validation, setup, builds, and player tests.

Diagnostics

Editor preview readiness, actual failure details, restart, and local logs.

Guide

Short offline instructions, packaged references, and the PDF guidebook.

The target bar identifies the Initializer and its actual settings owner. A single target is automatic; multiple targets require a choice. Clicking another Unity object does not retarget your work. Text commits on blur or Enter, invalid values stay unsaved, Undo/Redo remains native, and switching modes preserves every mode's saved values.

Studio's packaged page opens without internet, Node.js, or your game's development server. Editing or rebuilding the game UI still needs its normal toolchain. Builds stay local; a finished build is not a CDN publication or player-runtime test. Closing Studio does not cancel a build, and script-reload interruptions are never automatically replayed.

Recovery stays native. The existing UI Delivery and Preview Status menus open Studio's matching pages. If its interface cannot load, use Tools > ReLayer > Recovery for the same settings, validation, build, and preview services without React. Studio needs a matching Editor-native payload; an older Apple payload can use Recovery until the Studio-capable payload is installed and verified on Mac. This does not change existing Apple player delivery support.

Keep custom UI outside the imported package.

ReLayer separates imported package code, buyer-owned source, generated production output, and isolated working files. Asset Store reimports update the package while preserving your app.

PathOwnerPurpose
Assets/ReLayerPackageRuntime, editor integration, samples, and reusable kits
Assets/ReLayerUser/Overlay/TemplateYour projectEditable React/Vite application source
Assets/StreamingAssets/ReLayer/overlayGeneratedCurrent production output for user scenes
.relayer/profiles/default/OverlayTemplateReLayer work copyIsolated dependencies, dev server, and builds

Do not run npm install inside the Unity template folder. ReLayer installs dependencies in its isolated work copy so Unity never imports node_modules.

Choose the right Play Mode source.

Default

Auto

Prewarms managed Vite/HMR for the standard user source. Uses an existing current production build if live startup is unavailable, then reconnects when the live server becomes ready.

Explicit live

LiveDevServer

Requires the managed Vite development path and is useful when live iteration must be enforced.

Production view

BuiltOverlay

Loads current StreamingAssets output after checking the active source fingerprint. Stale output requires an explicit rebuild. This selection stays on built output when a live server becomes ready.

After installing Node.js or changing the toolchain, set RELAYER_NPM_PATH when needed, then choose Tools/ReLayer/Restart Overlay Session.

If the preview stays blank, open Studio > Diagnostics through Tools/ReLayer/Preview Status. If Studio itself cannot load, use Tools/ReLayer/Recovery for native failure details and actions. Startup retries are limited to three attempts, 20 seconds apart, and wait through compilation or Play Mode transitions. Exit Play Mode before using Retry / Restart Preview or Tools/ReLayer/Rebuild Overlay. Automatic preview checks do not install dependencies or rebuild the app; an explicit rebuild runs asynchronously and preserves the published output until validation succeeds.

Control the authoritative Play Mode DOM from a browser.

Choose Tools/ReLayer/Live Twin/Open. ReLayer opens a tokenized loopback page that mirrors the actual WebView owned by Unity; it does not run a second React app or add another bridge client.

Click, focus, blur, type, select, scroll, use keyboard and pointer actions, hover, drag, and submit forms
Ordered control from up to eight browser tabs with the latest authoritative result applied to every twin
Source-aware element metadata during Vite development when React debug evidence is available
DOM commands continue while Play Mode is paused; Unity game work may wait until resume
const status = await window.__RELAYER_LIVE_TWIN_V1__.getStatus()
await window.__RELAYER_LIVE_TWIN_V1__.click(mirrorElement)
await window.__RELAYER_LIVE_TWIN_V1__.setValue(mirrorInput, "Pilot")

Live Twin dispatches synthetic DOM events. Trusted-event and browser-activation workflows are unsupported. File input, clipboard permission, fullscreen, payments, downloads, external navigation, new windows, and arbitrary JavaScript are blocked.

Send named events in both directions.

Unity remains authoritative for game state. React renders UI and sends explicit actions back. Mark interactive React surfaces with data-relayer-hit so transparent areas keep normal Unity input.

Unity → React

ReLayerBridgeManager.GetOrCreate().Send(
    ReLayerBridgeEventType.UnityToUiToast,
    new ReLayerToastPayload
    {
        title = "Unity event received",
        body = "Sent from Unity."
    });

React → Unity

<button
  data-relayer-hit
  onClick={() => bridge.send('UI_ACTION', { action: 'pause' })}
>
  Pause
</button>

Use hasUnityRuntimeConnection() for Play-only loading gates and state requests. A native WebView callback alone can also exist for an Edit Mode visual preview.

Reuse package-owned components without giving up your app.

New templates import maintained kits through the stable #relayer/* namespace. Package updates can improve those kits while your application and styles remain in Assets/ReLayerUser.

import { Button, Card, TextField } from '#relayer/components'
import { GlassButton, GlassPanel, GlassRoot } from '#relayer/glass'
import { getComponentTheme } from '#relayer/themes'

const theme = getComponentTheme('edge')

Create a project-owned fork only when you need to edit kit internals. Forked files stay yours and are not updated by later package imports.

Use the exact first-party runtime matrix.

TargetBackendSupported runtime
Windows Editor and PlayerWebView2Windows x86_64 only; Edge WebView2 Runtime required
macOS Editor and PlayerWKWebViewApple Silicon arm64, macOS 11+
iOS deviceWKWebView XCFrameworkarm64 devices, iOS 12+
iOS SimulatorWKWebView XCFrameworkarm64 Simulator on Apple Silicon, iOS 14+
Android PlayerAndroid WebViewAPI level 21+; arm64-v8a and x86_64
WebGL PlayerSame-document DOM layerBrowser backend; no native plug-in
LinuxNoneNo bundled first-party backend

Update player UI through one Initializer.

Existing projects remain on StreamingAssets. Open Studio > UI Delivery, choose Bundled, Addressables, Hosted, Local, or Custom, run the tab's validation, then use its setup or build action. The old UI Delivery menu still opens this page. Switching tabs preserves every mode's values. ReLayer creates the manifest and content-derived version; you do not maintain release.json or version numbers by hand.

AWS S3 / CloudFront illustrated guide

Follow the English setup walkthrough with real AWS Console screenshot cards and generic examples. Ship the loader in a player once before UI-only updates. Hot updates are not officially supported on WebGL.

SourceDeliveryBest fit
StreamingAssetsBundled with the playerExisting behavior and guaranteed built-in fallback
HostedLoads an immutable version from one HTTPS directoryHybrid-style UI iteration without an offline copy of the remote site
AddressablesDownloads a verified .bytes package through your catalogS3 or CDN delivery with last installed UI available offline
PersistentDataPathVerifies and installs files copied by your appA project-owned local patch pipeline
CustomReceives a complete verified archive from your providerA proprietary patcher, CDN client, or existing download service

Hosted setup

  1. 1. Select Hosted and enter the public HTTPS deployment directory.
  2. 2. Build the UI update, upload its immutable releases/<version>/ files, verify them, then publish release.json last.
  3. 3. ReLayer checks at startup and every 30 seconds while foregrounded. Detection keeps the current document visible.
  4. 4. Hide and reopen the full ReLayer view, or call the shared apply API at a game-owned safe point.
await initializer.ApplyPreparedPlayerOverlayAsync()

Replacement waits for authenticated document boot, content version, React READY, and your optional Unity state restore hook. Commands from the old document and gameplay or purchase commands received during activation are discarded rather than replayed. A failed Hosted activation falls back to the built-in UI. Hosted does not promise an offline copy of the last website; choose Addressables when that requirement matters.

Addressables and custom updaters

Choose an Addressables release compatible with your Editor. Windows-tested pairs are Unity 2022.3.62f2 / Addressables 1.21.19 and Unity 6000.5.2f1 / Addressables 2.10.3; 1.21.19 cannot compile on Unity 6000.5. Keep the deployed player's Editor, Addressables version, and content-state baseline when publishing UI-only updates.

ReLayer creates or reuses only its dedicated group and key. It does not rewrite existing remote profiles or update the global catalog itself. If your game owns catalog updates, select Update control = Project and call InitializePlayerOverlayAsync() once after that updater completes. Later checks use PreparePlayerOverlayAsync() and the same apply API.

For a custom startup flow, use ShowBuiltInPlayerOverlayAsync() for the packaged shell, set a release key before initialization, or call ActivateLastGoodPlayerOverlayAsync() for a verified local UI. During state restoration, PlayerOverlayRestoreVersion identifies the document receiving the snapshot, including rollback. Separate media packs use ReLayerContentPackInstaller for verified installation.

A proprietary delivery client can implement IReLayerPlayerContentProvider and register one stable provider ID before the Initializer starts. The provider returns the generated overlay.bytes archive only; ReLayer still validates release.json, file hashes and compatibility, installs atomically, and owns safe application and rollback. It cannot bypass the Hosted trust boundary by returning a WebView URL.

Editor HMR stays the default. Enable Test player delivery in Play Mode before Play Mode when testing this loader. Otherwise, the Inspector explains that the normal preview is active and hides inactive update controls.

Player UI delivery cannot update C# or native functionality. Hosted accepts only the configured HTTPS origin and directory, blocks redirects and frames from gaining the Unity bridge, and keeps per-document authentication enabled even in PlainText bridge mode. Store approval depends on the actual remote change.

Serve the player and overlay over HTTPS.

WebGL imports the overlay into a ReLayer-owned DOM layer aligned with the Unity canvas. Keep the player page, Build files, and StreamingAssets/ReLayer content on the same origin when possible.

  • Production requires HTTPS; file:// is unsupported and plain HTTP is loopback-development only.
  • Split origins need CORS for overlay HTML, modules, CSS, fonts, images, and media.
  • CSP must allow Unity/WASM plus ReLayer connections, styles, assets, and blob: module URLs.
  • Use a CSP nonce ReLayer can copy, or explicitly allow the required inline import maps and scoped styles.
SuffixContent-TypeContent-Encoding
.js.gzapplication/javascriptgzip
.wasm.gzapplication/wasmgzip
.data.gzapplication/octet-streamgzip

Let Unity keep the production overlay current.

Player builds rebuild the active overlay before the Unity build starts, regardless of the Editor Play Mode source. Use the manual helper only when you intentionally need production output outside a player build.

Assets/ReLayer/Core/Build/build-overlay.ps1

# Optional: omit bundled example themes
Assets/ReLayer/Core/Build/build-overlay.ps1 -ExcludeExampleThemes

The packaged Showcase is isolated at Assets/StreamingAssets/ReLayer/showcase. User scenes load the project output at Assets/StreamingAssets/ReLayer/overlay.