# oculus-samples/unity-discover architecture

> Architecture diagram of the GitHub repository oculus-samples/unity-discover, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oculus-samples/unity-discover
- Repository: https://github.com/oculus-samples/unity-discover

## Overview

This tree centers on three Unity utility packages: avatar setup and mesh inspection, XR controller/tracking input, and reusable Unity helpers. The main workflow represented is XR actions and tracking entering the input manager, then feeding hand data or avatar tracking; avatar meshes are cached and queried after loading. The README also names Scene API, Interaction SDK, Passthrough, spatial anchors, and multiplayer, but their application-level implementations are not present in this supplied tree. Relationships below are limited to source-index references or shown calls.

Main entry points: [`Packages/com.meta.utilities.input/XRInputManager.cs`](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputManager.cs) (XR input manager), [`Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs`](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs) (Mesh queries), [`Packages/com.meta.utilities/AutoSet.cs`](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AutoSet.cs) (AutoSet attribute), [`Packages/com.meta.utilities.input/XRInputProvider.cs`](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputProvider.cs) (Input provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_avatars["Avatar utilities"]
  node_avatar_entity["Avatar entity<br/>[AvatarEntity.cs]"]
  node_mesh_cache[("Mesh cache<br/>[AvatarMeshCache.cs]")]
  node_mesh_query["Mesh queries<br/>[AvatarMeshQuery.cs]"]
  node_arm_info["Arm mesh info"]
end

subgraph group_input["XR input"]
  node_xr_manager["XR input manager<br/>[XRInputManager.cs]"]
  node_control_actions["Controller actions"]
  node_control_delegate["Control delegate"]
  node_tracking_delegate["Tracking delegate"]
  node_input_provider["Input provider<br/>[XRInputProvider.cs]"]
  node_hand_source["XR hand source"]
  node_hmd_source["XR HMD source"]
  node_animated_hand["Animated hand<br/>[XRAnimatedHand.cs]"]
  node_hand_helpers["Hand interaction helpers<br/>[Interaction]"]
  node_input_support["Input support tools"]
end

subgraph group_utilities["Unity utilities"]
  node_auto_set["AutoSet attribute<br/>[AutoSet.cs]"]
  node_auto_set_processor["AutoSet processor"]
  node_singleton["Singleton base<br/>[Singleton.cs]"]
  node_animation_triggers["Animation triggers"]
  node_animation_listener["Trigger listener"]
  node_enum_dictionary["Enum dictionary<br/>[EnumDictionary.cs]"]
  node_network_settings["Network settings<br/>[NetworkSettings.cs]"]
  node_network_toolbar["Network toolbar"]
  node_general_helpers["General helpers<br/>[com.meta.utilities]"]
end

node_avatar_entity -->|"uses attribute"| node_auto_set
node_avatar_entity -.->|"provides avatar data"| node_mesh_query
node_mesh_query -->|"reads mesh data"| node_mesh_cache
node_mesh_query -->|"checks avatar state"| node_avatar_entity
node_arm_info -->|"uses queries"| node_mesh_query
node_mesh_cache -->|"inherits from"| node_singleton
node_mesh_cache -->|"uses attribute"| node_auto_set
node_xr_manager -->|"enables actions"| node_control_actions
node_xr_manager -->|"creates delegate"| node_control_delegate
node_xr_manager -->|"creates delegate"| node_tracking_delegate
node_control_delegate -->|"reads actions"| node_control_actions
node_input_provider -->|"references manager"| node_xr_manager
node_input_provider -->|"inherits from"| node_singleton
node_input_provider -->|"uses attribute"| node_auto_set
node_hand_source -->|"reads hand actions"| node_xr_manager
node_animated_hand -->|"reads tracking input"| node_xr_manager
node_animated_hand -->|"reads actions"| node_control_actions
node_auto_set_processor -->|"resolves fields"| node_auto_set
node_animation_triggers -->|"uses listener"| node_animation_listener
node_network_toolbar -->|"reads and sets"| node_network_settings

click node_avatar_entity "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarEntity.cs"
click node_mesh_cache "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshCache.cs"
click node_mesh_query "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs"
click node_arm_info "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshArmInfo.cs"
click node_xr_manager "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputManager.cs"
click node_control_actions "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputControlActions.cs"
click node_control_delegate "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputControlDelegate.cs"
click node_tracking_delegate "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputTrackingDelegate.cs"
click node_input_provider "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputProvider.cs"
click node_hand_source "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/Interaction/FromXRHandDataSource.cs"
click node_hmd_source "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/Interaction/FromXRHmdDataSource.cs"
click node_animated_hand "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRAnimatedHand.cs"
click node_hand_helpers "https://github.com/oculus-samples/unity-discover/tree/main/Packages/com.meta.utilities.input/Interaction"
click node_input_support "https://github.com/oculus-samples/unity-discover/tree/main/Packages/com.meta.utilities.input"
click node_auto_set "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AutoSet.cs"
click node_auto_set_processor "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/Editor/AutoSetPostprocessor.cs"
click node_singleton "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/Singleton.cs"
click node_animation_triggers "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AnimationStateTriggers.cs"
click node_animation_listener "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AnimationStateTriggerListener.cs"
click node_enum_dictionary "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/EnumDictionary.cs"
click node_network_settings "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/NetworkSettings.cs"
click node_network_toolbar "https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/Editor/NetworkSettingsToolbar.cs"
click node_general_helpers "https://github.com/oculus-samples/unity-discover/tree/main/Packages/com.meta.utilities"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_avatar_entity,node_mesh_cache,node_mesh_query,node_arm_info toneBlue
class node_xr_manager,node_control_actions,node_control_delegate,node_tracking_delegate,node_input_provider,node_hand_source,node_hmd_source,node_animated_hand,node_hand_helpers,node_input_support toneAmber
class node_auto_set,node_auto_set_processor,node_singleton,node_animation_triggers,node_animation_listener,node_enum_dictionary,node_network_settings,node_network_toolbar,node_general_helpers toneMint
```

## Components

### Avatar utilities

- [Avatar entity](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarEntity.cs): `Packages/com.meta.utilities.avatars/Avatar/AvatarEntity.cs`
- [Mesh cache](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshCache.cs): `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshCache.cs`
- [Mesh queries](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs): `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs`
- [Arm mesh info](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshArmInfo.cs): `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshArmInfo.cs`

### XR input

- [XR input manager](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputManager.cs): `Packages/com.meta.utilities.input/XRInputManager.cs`
- [Controller actions](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputControlActions.cs): `Packages/com.meta.utilities.input/XRInputControlActions.cs`
- [Control delegate](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputControlDelegate.cs): `Packages/com.meta.utilities.input/XRInputControlDelegate.cs`
- [Tracking delegate](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputTrackingDelegate.cs): `Packages/com.meta.utilities.input/XRInputTrackingDelegate.cs`
- [Input provider](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRInputProvider.cs): `Packages/com.meta.utilities.input/XRInputProvider.cs`
- [XR hand source](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/Interaction/FromXRHandDataSource.cs): `Packages/com.meta.utilities.input/Interaction/FromXRHandDataSource.cs`
- [XR HMD source](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/Interaction/FromXRHmdDataSource.cs): `Packages/com.meta.utilities.input/Interaction/FromXRHmdDataSource.cs`
- [Animated hand](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities.input/XRAnimatedHand.cs): `Packages/com.meta.utilities.input/XRAnimatedHand.cs`
- [Hand interaction helpers](https://github.com/oculus-samples/unity-discover/tree/main/Packages/com.meta.utilities.input/Interaction): `Packages/com.meta.utilities.input/Interaction`
- [Input support tools](https://github.com/oculus-samples/unity-discover/tree/main/Packages/com.meta.utilities.input): `Packages/com.meta.utilities.input`

### Unity utilities

- [AutoSet attribute](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AutoSet.cs): `Packages/com.meta.utilities/AutoSet.cs`
- [AutoSet processor](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/Editor/AutoSetPostprocessor.cs): `Packages/com.meta.utilities/Editor/AutoSetPostprocessor.cs`
- [Singleton base](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/Singleton.cs): `Packages/com.meta.utilities/Singleton.cs`
- [Animation triggers](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AnimationStateTriggers.cs): `Packages/com.meta.utilities/AnimationStateTriggers.cs`
- [Trigger listener](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/AnimationStateTriggerListener.cs): `Packages/com.meta.utilities/AnimationStateTriggerListener.cs`
- [Enum dictionary](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/EnumDictionary.cs): `Packages/com.meta.utilities/EnumDictionary.cs`
- [Network settings](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/NetworkSettings.cs): `Packages/com.meta.utilities/NetworkSettings.cs`
- [Network toolbar](https://github.com/oculus-samples/unity-discover/blob/main/Packages/com.meta.utilities/Editor/NetworkSettingsToolbar.cs): `Packages/com.meta.utilities/Editor/NetworkSettingsToolbar.cs`
- [General helpers](https://github.com/oculus-samples/unity-discover/tree/main/Packages/com.meta.utilities): `Packages/com.meta.utilities`

## Connections

- Avatar entity → AutoSet attribute: uses attribute (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarEntity.cs`)
- Avatar entity → Mesh queries: provides avatar data (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs`)
- Mesh queries → Mesh cache: reads mesh data (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs`)
- Mesh queries → Avatar entity: checks avatar state (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshQuery.cs`)
- Arm mesh info → Mesh queries: uses queries (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshArmInfo.cs`)
- Mesh cache → Singleton base: inherits from (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshCache.cs`)
- Mesh cache → AutoSet attribute: uses attribute (evidence: `Packages/com.meta.utilities.avatars/Avatar/AvatarMeshUtils/AvatarMeshCache.cs`)
- XR input manager → Controller actions: enables actions (evidence: `Packages/com.meta.utilities.input/XRInputManager.cs`)
- XR input manager → Control delegate: creates delegate (evidence: `Packages/com.meta.utilities.input/XRInputManager.cs`)
- XR input manager → Tracking delegate: creates delegate (evidence: `Packages/com.meta.utilities.input/XRInputManager.cs`)
- Control delegate → Controller actions: reads actions (evidence: `Packages/com.meta.utilities.input/XRInputControlDelegate.cs`)
- Input provider → XR input manager: references manager (evidence: `Packages/com.meta.utilities.input/XRInputProvider.cs`)
- Input provider → Singleton base: inherits from (evidence: `Packages/com.meta.utilities.input/XRInputProvider.cs`)
- Input provider → AutoSet attribute: uses attribute (evidence: `Packages/com.meta.utilities.input/XRInputProvider.cs`)
- XR hand source → XR input manager: reads hand actions (evidence: `Packages/com.meta.utilities.input/Interaction/FromXRHandDataSource.cs`)
- Animated hand → XR input manager: reads tracking input (evidence: `Packages/com.meta.utilities.input/XRAnimatedHand.cs`)
- Animated hand → Controller actions: reads actions (evidence: `Packages/com.meta.utilities.input/XRAnimatedHand.cs`)
- AutoSet processor → AutoSet attribute: resolves fields (evidence: `Packages/com.meta.utilities/Editor/AutoSetPostprocessor.cs`)
- Animation triggers → Trigger listener: uses listener (evidence: `Packages/com.meta.utilities/AnimationStateTriggers.cs`)
- Network toolbar → Network settings: reads and sets (evidence: `Packages/com.meta.utilities/Editor/NetworkSettingsToolbar.cs`)
