$ show oculus-samples/Unity-PassthroughCameraApiSamples
This is an official Meta-published Unity sample repository demonstrating the Passthrough Camera API for Quest 3/3S headsets. It contains five distinct sample scenes: CameraViewer (live camera feed display), CameraToWorld (camera-space to world-space coordinate mapping with debug visualization), BrightnessEstimation (ambient light estimation from camera pixels), MultiObjectDetection (real-time object detection using YOLO via Unity Sentis, with 3D marker spawning), and ShaderSample (water shader using camera texture as reflection source). The architecture is a collection of independent scenes, each with its own manager MonoBehaviour and shared utility scripts (InputManager, DebugUIBuilder). The project targets Android via OpenXR and the Meta XR SDK (MRUK 85.0.0), with hand tracking and controller support. It is a learning resource, not a production application, but the code is well-structured with consistent conventions and several reusable patterns.
The LLM identified 4 files worth highlighting for reuse:
Singleton MonoBehaviour that abstracts hand pinch gestures and controller button presses (A/B, thumbstick) into a unified event-based API. Uses DontDestroyOnLoad to persist across scenes. This pattern is reusable in any XR Unity project that needs to decouple input source detection from game logic.
Dynamic UI generation system for creating debug panels at runtime. Provides methods to add buttons, sliders, toggles, labels, text fields, and radio buttons with automatic layout. Each element is spawned from prefabs defined in the inspector. This is a reusable debug overlay pattern common in XR development.
Unity Editor tool that converts an ONNX model to the Sentis format with an added Non-Maximum Suppression (NMS) layer. Automates the conversion workflow for YOLO object detection models. This script is self-contained and can be reused in any Unity project using Sentis for object detection.
Animation component for 3D detection markers: rotates the marker to face the camera (billboard) and applies a pulsing scale animation. Attached to a prefab that includes a sphere and text label. This pattern is reusable for any 3D UI element that needs to draw attention to a spatial point.