How uwrealitylabs/universal-text-unity works
Primary Components
• Unity Engine Core – This is the runtime platform where the application executes using Unity 2022.3.24f1.
• XR Integration Layer – Components include Oculus configuration (OculusLoader, OculusProjectConfig.asset) and the XR Interaction Toolkit (samples, XR origin prefabs and interactors). This layer handles VR/AR input, controller events, simulation settings, and overall XR runtime support.
• Universal Text Functionality – The “Universal Text” modules (e.g., UniversalTextScanner in Scripts/Core/UniversalTextScanner and UniversalTextTag) represent the core functional aspects of the package. They handle text capture, tagging, scanning, and maybe semantic interpretation.
• LLM/Conversation Module – Found in the Scripts/LLM directory (e.g., ChatGPTHandler.cs). This module likely interacts with an external language model or provides demo interactions based on text input.
• UI and Scene Management – Several prefabs (e.g., Sent/Received Message prefabs, UI Sample prefabs in Assets/Samples), Scenes, and TextMesh Pro assets, collectively manage visual feedback and interactions in the UI, both in 3D and in overlays.
• External Assets/Packages – Third-party dependencies like TextMesh Pro, NuGet packages (for dependency management), and additional sample scene assets that support XR interaction and improve demonstration quality.
Relationships and Interactions
• The Unity Engine acts as the foundation that interconnects all components.
• The XR Integration layer provides the input events and hardware device abstraction. These input events feed directly into the interactive prefabs and controllers, which then pass events to the Universal Text components.
• The Universal Text Scanner and Tag modules interact with the LLM modules to provide additional functionality (such as natural language processing and dynamic text interpretation). Visual cues and messages are rendered via Unity Scenes and UI components.
• The UI and Scene Management components use assets (like TextMesh Pro and prefabs) to render textual output and interactive elements. They both subscribe to events from the underlying text scanning and XR input systems.
• External libraries (NuGet packages, XR-specific packages, etc.) support these interactions by providing underlying frameworks (such as XR device simulation or text formatting).
Architectural Patterns & Design Principles
• Separation of Concerns – Input handling, text scanning/tagging, language model processing, and visual presentation are handled by separate modules, promoting a clean architecture.