# godof3worlds/stern-gerlach-exp architecture

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

- Interactive diagram: https://gitdiagram.com/godof3worlds/stern-gerlach-exp
- Repository: https://github.com/godof3worlds/stern-gerlach-exp

## Overview

This Unity project appears to be an interactive Stern–Gerlach experiment, with scenes and assets for a silver-atom beam, magnetic apparatus, player controls, and runtime UI. The likely user workflow is to enter the experiment, interact with or observe the apparatus, and see the atom behavior and experiment state. The README is empty, and the only sampled source is unrelated Burst-generated code; therefore, connections among the named game components are shown as unverified rather than asserted as inspected call paths.

Main entry points: [`Assets/MainScene.unity`](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/MainScene.unity) (Experiment scene), [`Assets/Script/AtomSpawner.cs`](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/AtomSpawner.cs) (Atom spawner), [`Assets/Script/MagnetManager.cs`](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/MagnetManager.cs) (Magnet manager), [`Assets/HomeMenue.unity`](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/HomeMenue.unity) (Home scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Scenes and navigation"]
  node_home["Home scene<br/>[HomeMenue.unity]"]
  node_main["Experiment scene<br/>[MainScene.unity]"]
  node_sample["Sample scene<br/>[SampleScene.unity]"]
end

subgraph group_simulation["Experiment simulation"]
  node_atomspawn["Atom spawner<br/>[AtomSpawner.cs]"]
  node_silver["Silver atom<br/>[SilverSc.cs]"]
  node_silverio["Silver IO<br/>[SIlverIO.cs]"]
  node_magnet["Magnet manager<br/>[MagnetManager.cs]"]
  node_furnace["Furnace<br/>[Furnace.prefab]"]
  node_atomprefab["Silver atom prefab<br/>[SilverAtom.prefab]"]
  node_ns["N-S magnet<br/>[N-Smag.prefab]"]
  node_sn["S-N magnet<br/>[S-Nmag.prefab]"]
end

subgraph group_interaction["Controls and camera"]
  node_player["Player<br/>[PlayerMovement.cs]"]
  node_input["Input actions<br/>[InputAct.cs]"]
  node_orbit["Orbit camera"]
end

subgraph group_presentation["Runtime presentation"]
  node_hudlogic["HUD controller"]
  node_hudview["Experiment HUD"]
  node_hudstyle["HUD styles"]
  node_menuview["Menu UI<br/>[menue.uxml]"]
end

node_user(("Player"))

node_user -.->|"opens"| node_home
node_home -.->|"shows"| node_menuview
node_user -.->|"controls"| node_player
node_input -.->|"provides input"| node_player
node_user -.->|"enters experiment"| node_main
node_main -.->|"hosts"| node_atomspawn
node_atomspawn -.->|"spawns"| node_atomprefab
node_atomprefab -.->|"uses behavior"| node_silver
node_atomspawn -.->|"emits from"| node_furnace
node_main -.->|"hosts"| node_magnet
node_magnet -.->|"configures"| node_ns
node_magnet -.->|"configures"| node_sn
node_main -.->|"hosts"| node_silverio
node_main -.->|"hosts"| node_orbit
node_main -.->|"hosts"| node_hudlogic
node_hudlogic -.->|"updates"| node_hudview
node_hudview -.->|"styled by"| node_hudstyle
node_sample -.->|"may demonstrate"| node_main

click node_player "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/PlayerMovement.cs"
click node_input "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/InputAct.cs"
click node_orbit "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/CinematicOrbitCamera.cs"
click node_atomspawn "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/AtomSpawner.cs"
click node_silver "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/SilverSc.cs"
click node_silverio "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/SIlverIO.cs"
click node_magnet "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/MagnetManager.cs"
click node_furnace "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/Furnace.prefab"
click node_atomprefab "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/SilverAtom.prefab"
click node_ns "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/N-Smag.prefab"
click node_sn "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/S-Nmag.prefab"
click node_hudlogic "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/SternGerlachHUDController.cs"
click node_hudview "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/UI%20Toolkit/SternGerlachHUD.uxml"
click node_hudstyle "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/SternGerlachHUD.uss"
click node_menuview "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/UI%20Toolkit/menue.uxml"
click node_home "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/HomeMenue.unity"
click node_main "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/MainScene.unity"
click node_sample "https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Scenes/SampleScene.unity"

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_home,node_main,node_sample toneBlue
class node_atomspawn,node_silver,node_silverio,node_magnet,node_furnace,node_atomprefab,node_ns,node_sn toneAmber
class node_player,node_input,node_orbit toneMint
class node_hudlogic,node_hudview,node_hudstyle,node_menuview toneRose
class node_user toneIndigo
```

## Components

### Scenes and navigation

- [Home scene](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/HomeMenue.unity): `Assets/HomeMenue.unity`
- [Experiment scene](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/MainScene.unity): `Assets/MainScene.unity`
- [Sample scene](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Scenes/SampleScene.unity): `Assets/Scenes/SampleScene.unity`

### Experiment simulation

- [Atom spawner](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/AtomSpawner.cs): `Assets/Script/AtomSpawner.cs`
- [Silver atom](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/SilverSc.cs): `Assets/Script/SilverSc.cs`
- [Silver IO](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/SIlverIO.cs): `Assets/Script/SIlverIO.cs`
- [Magnet manager](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/MagnetManager.cs): `Assets/Script/MagnetManager.cs`
- [Furnace](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/Furnace.prefab): `Assets/prefab/Furnace.prefab`
- [Silver atom prefab](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/SilverAtom.prefab): `Assets/prefab/SilverAtom.prefab`
- [N-S magnet](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/N-Smag.prefab): `Assets/prefab/N-Smag.prefab`
- [S-N magnet](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/prefab/S-Nmag.prefab): `Assets/prefab/S-Nmag.prefab`

### Controls and camera

- [Player](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/PlayerMovement.cs): `Assets/Script/PlayerMovement.cs`
- [Input actions](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/InputAct.cs): `Assets/InputAct.cs`
- [Orbit camera](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/CinematicOrbitCamera.cs): `Assets/Script/CinematicOrbitCamera.cs`

### Runtime presentation

- [HUD controller](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/Script/SternGerlachHUDController.cs): `Assets/Script/SternGerlachHUDController.cs`
- [Experiment HUD](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/UI%20Toolkit/SternGerlachHUD.uxml): `Assets/UI Toolkit/SternGerlachHUD.uxml`
- [HUD styles](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/SternGerlachHUD.uss): `Assets/SternGerlachHUD.uss`
- [Menu UI](https://github.com/godof3worlds/stern-gerlach-exp/blob/main/Assets/UI%20Toolkit/menue.uxml): `Assets/UI Toolkit/menue.uxml`

### Other components

- **Player**

## Connections

- Player → Home scene: opens
- Home scene → Menu UI: shows
- Player → Player: controls
- Input actions → Player: provides input
- Player → Experiment scene: enters experiment
- Experiment scene → Atom spawner: hosts
- Atom spawner → Silver atom prefab: spawns
- Silver atom prefab → Silver atom: uses behavior
- Atom spawner → Furnace: emits from
- Experiment scene → Magnet manager: hosts
- Magnet manager → N-S magnet: configures
- Magnet manager → S-N magnet: configures
- Experiment scene → Silver IO: hosts
- Experiment scene → Orbit camera: hosts
- Experiment scene → HUD controller: hosts
- HUD controller → Experiment HUD: updates
- Experiment HUD → HUD styles: styled by
- Sample scene → Experiment scene: may demonstrate
