The Unity WebGL 3D interactive environment component of the LeadXP Virtual Event Platform. Renders an explorable virtual booth space embedded directly in the browser via WebGL, communicating with the Next.js host application through a JavaScript bridge.
- Interactive 3D Environment: Orbit, pan, and zoom a virtual event floor using touch and mouse input
- Speaker Booths: Clickable speaker objects that trigger navigation in the host app
- Camera Focus: Smooth camera transitions to focus on selected booths
- Browser Bridge: Two-way communication with the surrounding Next.js app via
jslibinterop - WebGL Build: Optimised export for embedding in a web page as an
<iframe>or Unity WebGL loader
This project acts as the 3D viewport embedded inside the LeadXP platform. When a user clicks a speaker booth:
Speaker.OnMouseDownfires -> callsBrowserBridge.ObjectClicked(id)BrowserBridgecalls theNotifyObjectClickedextern, invoking a JavaScript function in the host page- The Next.js host receives the event and navigates to the selected speaker's profile
Assets/
└── Scripts/
├── BrowserInteraction/
│ └── BrowserBridge.cs # JS interop — sends click events to the host page
├── Camera/
│ ├── CameraController.cs # Orbit / pan / zoom with touch & mouse
│ └── CameraClickEvent.cs # Base class; focuses camera on a clicked object
├── Interaction/
│ └── ClickHandler.cs # Generic click -> BrowserBridge
├── Managers/
│ └── SelectionManager.cs # Singleton registry of active Speaker instances
└── Speaker/
└── Speaker.cs # Registers with SelectionManager; handles booth clicks
- Unity 6000.0.54f1 (Unity 6)
- WebGL Build Support module installed
- Open Unity Hub
- Click Add -> Add project from disk
- Select the
UnityWebGLEventSpacefolder - Open the
Assets/Scenes/App.unityscene
- File -> Build Settings
- Select WebGL platform (install the module if prompted)
- Click Switch Platform
- Click Build and output to
Builds/
The resulting build can be served alongside the Next.js app or hosted on a CDN, with the URL set via NEXT_PUBLIC_BLOB_URL in the platform's .env.local.
| Type | Convention |
|---|---|
| Public | PascalCase |
| Private | _camelCase |
| Internal | camelCase |
| Constant | SCREAMING_SNAKE_CASE |
| Interface | IInterface |
| Enum | Type: PascalCase · State: SCREAMING_SNAKE_CASE |