# didi514354875/pgrstudio architecture

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

- Interactive diagram: https://gitdiagram.com/didi514354875/pgrstudio
- Repository: https://github.com/didi514354875/pgrstudio
- Video tour (about a minute): https://gitdiagram.com/didi514354875/pgrstudio/video

## Overview

PGRStudio is a Punishing: Gray Raven-focused Unity asset browser and exporter, based on AssetStudio. Its documented workflow is to build a versioned PGR map, then load game files; users can inspect and export assets through the GUI or CLI. The graph separates mapping, container/serialized-file ingestion, Unity object decoding, and export. Source-index references and excerpts support the core parsing links; GUI wiring and several export paths are not sampled, so those relationships are omitted or marked unverified.

Main entry points: [`AssetStudio/AssetsManager.cs`](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/AssetsManager.cs) (Asset manager), [`AssetStudioGUI/AssetStudioGUIForm.cs`](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioGUI/AssetStudioGUIForm.cs) (GUI application), [`AssetStudioCLI/Program.cs`](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Program.cs) (CLI application), [`AssetStudioGUI/Exporter.cs`](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioGUI/Exporter.cs) (GUI exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["User interfaces"]
  node_gui["GUI application"]
  node_cli["CLI application<br/>[Program.cs]"]
  node_assetitems["Asset listings<br/>[AssetItem.cs]"]
end

subgraph group_mapping["PGR mapping"]
  node_cabmap[("PGR map<br/>[CABManager.cs]")]
end

subgraph group_ingestion["File ingestion"]
  node_assetmanager["Asset manager<br/>[AssetsManager.cs]"]
  node_bundle["Bundle reader<br/>[BundleFile.cs]"]
  node_serialized["Serialized files<br/>[SerializedFile.cs]"]
  node_objectreader["Object reader<br/>[ObjectReader.cs]"]
end

subgraph group_assets["Unity assets"]
  node_unityobjects["Unity object types"]
  node_animation["Animation data<br/>[AnimationClip.cs]"]
  node_animcontroller["Animator controllers"]
  node_math["Unity math types"]
end

subgraph group_export["Conversion and export"]
  node_cli_exporter["CLI exporter<br/>[Exporter.cs]"]
  node_gui_exporter["GUI exporter<br/>[Exporter.cs]"]
  node_modelconvert["Model conversion<br/>[ModelConverter.cs]"]
  node_fbx["FBX export"]
  node_textureconvert["Texture decoding<br/>[TextureDecoder.cs]"]
  node_audio["Audio conversion"]
end

node_user(("User"))

node_user -->|"uses"| node_gui
node_user -->|"runs"| node_cli
node_cli -->|"builds map"| node_cabmap
node_user -->|"builds first"| node_cabmap
node_cabmap -.->|"supports loading"| node_assetmanager
node_gui -.->|"loads assets"| node_assetmanager
node_cli -.->|"loads assets"| node_assetmanager
node_assetmanager -->|"opens bundles"| node_bundle
node_assetmanager -->|"loads files"| node_serialized
node_bundle -->|"contains files"| node_serialized
node_serialized -.->|"provides object data"| node_objectreader
node_objectreader -.->|"decodes objects"| node_unityobjects
node_unityobjects -->|"includes animation"| node_animation
node_unityobjects -->|"includes controllers"| node_animcontroller
node_animation -->|"uses vectors"| node_math
node_animcontroller -->|"references clips"| node_animation
node_gui -.->|"lists assets"| node_assetitems
node_cli -.->|"exports assets"| node_cli_exporter
node_gui -.->|"exports assets"| node_gui_exporter
node_cli_exporter -.->|"converts models"| node_modelconvert
node_gui_exporter -.->|"converts models"| node_modelconvert
node_modelconvert -->|"writes FBX"| node_fbx
node_gui_exporter -.->|"decodes textures"| node_textureconvert
node_cli_exporter -.->|"decodes textures"| node_textureconvert
node_gui_exporter -.->|"converts audio"| node_audio

click node_gui "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioGUI/AssetStudioGUIForm.cs"
click node_cli "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Program.cs"
click node_cabmap "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/CABManager.cs"
click node_assetmanager "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/AssetsManager.cs"
click node_bundle "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/BundleFile.cs"
click node_serialized "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/SerializedFile.cs"
click node_objectreader "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/ObjectReader.cs"
click node_unityobjects "https://github.com/didi514354875/pgrstudio/tree/master/AssetStudio/Classes"
click node_animation "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/Classes/AnimationClip.cs"
click node_animcontroller "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/Classes/AnimatorController.cs"
click node_math "https://github.com/didi514354875/pgrstudio/tree/master/AssetStudio/Math"
click node_assetitems "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Components/AssetItem.cs"
click node_cli_exporter "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Exporter.cs"
click node_gui_exporter "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioGUI/Exporter.cs"
click node_modelconvert "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioUtility/ModelConverter.cs"
click node_fbx "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioFBXWrapper/FbxExporterContext.cs"
click node_textureconvert "https://github.com/didi514354875/pgrstudio/blob/master/Texture2DDecoderWrapper/TextureDecoder.cs"
click node_audio "https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioUtility/AudioClipConverter.cs"

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_gui,node_cli,node_assetitems,node_user toneBlue
class node_cabmap toneAmber
class node_assetmanager,node_bundle,node_serialized,node_objectreader toneMint
class node_unityobjects,node_animation,node_animcontroller,node_math toneRose
class node_cli_exporter,node_gui_exporter,node_modelconvert,node_fbx,node_textureconvert,node_audio toneIndigo
```

## Components

### User interfaces

- [GUI application](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioGUI/AssetStudioGUIForm.cs): `AssetStudioGUI/AssetStudioGUIForm.cs`
- [CLI application](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Program.cs): `AssetStudioCLI/Program.cs`
- [Asset listings](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Components/AssetItem.cs): `AssetStudioCLI/Components/AssetItem.cs`

### PGR mapping

- [PGR map](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/CABManager.cs): `AssetStudio/CABManager.cs`

### File ingestion

- [Asset manager](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/AssetsManager.cs): `AssetStudio/AssetsManager.cs`
- [Bundle reader](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/BundleFile.cs): `AssetStudio/BundleFile.cs`
- [Serialized files](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/SerializedFile.cs): `AssetStudio/SerializedFile.cs`
- [Object reader](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/ObjectReader.cs): `AssetStudio/ObjectReader.cs`

### Unity assets

- [Unity object types](https://github.com/didi514354875/pgrstudio/tree/master/AssetStudio/Classes): `AssetStudio/Classes`
- [Animation data](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/Classes/AnimationClip.cs): `AssetStudio/Classes/AnimationClip.cs`
- [Animator controllers](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudio/Classes/AnimatorController.cs): `AssetStudio/Classes/AnimatorController.cs`
- [Unity math types](https://github.com/didi514354875/pgrstudio/tree/master/AssetStudio/Math): `AssetStudio/Math`

### Conversion and export

- [CLI exporter](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioCLI/Exporter.cs): `AssetStudioCLI/Exporter.cs`
- [GUI exporter](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioGUI/Exporter.cs): `AssetStudioGUI/Exporter.cs`
- [Model conversion](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioUtility/ModelConverter.cs): `AssetStudioUtility/ModelConverter.cs`
- [FBX export](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioFBXWrapper/FbxExporterContext.cs): `AssetStudioFBXWrapper/FbxExporterContext.cs`
- [Texture decoding](https://github.com/didi514354875/pgrstudio/blob/master/Texture2DDecoderWrapper/TextureDecoder.cs): `Texture2DDecoderWrapper/TextureDecoder.cs`
- [Audio conversion](https://github.com/didi514354875/pgrstudio/blob/master/AssetStudioUtility/AudioClipConverter.cs): `AssetStudioUtility/AudioClipConverter.cs`

### Other components

- **User**

## Connections

- User → GUI application: uses (evidence: `README.md`)
- User → CLI application: runs (evidence: `README.md`)
- CLI application → PGR map: builds map (evidence: `AssetStudioCLI/Program.cs`)
- User → PGR map: builds first (evidence: `README.md`)
- PGR map → Asset manager: supports loading (evidence: `AssetStudio/AssetsManager.cs`)
- GUI application → Asset manager: loads assets
- CLI application → Asset manager: loads assets
- Asset manager → Bundle reader: opens bundles (evidence: `AssetStudio/AssetsManager.cs`)
- Asset manager → Serialized files: loads files (evidence: `AssetStudio/AssetsManager.cs`)
- Bundle reader → Serialized files: contains files (evidence: `AssetStudio/BundleFile.cs`)
- Serialized files → Object reader: provides object data (evidence: `AssetStudio/ObjectReader.cs`)
- Object reader → Unity object types: decodes objects (evidence: `AssetStudio/Classes/AnimatorController.cs`)
- Unity object types → Animation data: includes animation (evidence: `AssetStudio/ClassIDType.cs`)
- Unity object types → Animator controllers: includes controllers (evidence: `AssetStudio/ClassIDType.cs`)
- Animation data → Unity math types: uses vectors (evidence: `AssetStudio/Classes/AnimationClip.cs`)
- Animator controllers → Animation data: references clips (evidence: `AssetStudio/Classes/AnimatorController.cs`)
- GUI application → Asset listings: lists assets
- CLI application → CLI exporter: exports assets
- GUI application → GUI exporter: exports assets
- CLI exporter → Model conversion: converts models
- GUI exporter → Model conversion: converts models
- Model conversion → FBX export: writes FBX (evidence: `AssetStudioUtility/ModelConverter.cs`)
- GUI exporter → Texture decoding: decodes textures
- CLI exporter → Texture decoding: decodes textures
- GUI exporter → Audio conversion: converts audio
