# x753/lethal-company-more-suits architecture

> Architecture diagram of the GitHub repository x753/lethal-company-more-suits, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/x753/lethal-company-more-suits
- Repository: https://github.com/x753/lethal-company-more-suits

## Overview

##### Project type and purpose
- This is a Unity‐based game mod (an open-source plugin) built on the BepInEx mod loader for Among Us.
- Its purpose is to provide a library that dynamically loads additional “suit” assets (PNG + optional JSON metadata) at runtime.

##### File structure
- Top level:
- MoreSuits.cs – the single C# source file that compiles into MoreSuits.dll
- CHANGELOG.md, LICENSE, README.md – documentation and history
- At runtime you also have:
- BepInEx/Plugins/x753-More_Suits-X.X.X/MoreSuits.dll
- BepInEx/Plugins/x753-More_Suits-X.X.X/moresuits/…PNG files
- BepInEx/Plugins/x753-More_Suits-X.X.X/advanced/…JSON files
- BepInEx/config/x753.More_Suits.cfg
- Optional !less-suits.txt

##### README for additional insights
- The plugin scans the “moresuits” folder for PNGs and optional JSONs in “advanced”
- It writes/reads a config file to enable/disable specific suits
- It exposes itself as a library so third-party mod packages can drop PNGs into “moresuits” without bundling the DLL

##### Main components and their interactions
a. Unity Game Engine (Among Us)
b. BepInEx Loader
c. MoreSuits Plugin (MoreSuits.dll)
d. Asset folders:
- /moresuits (user/custom suit PNGs)
- /advanced (optional JSON per suit + extra textures)
e. Configuration subsystem
f. Optional External mod packages (depend on MoreSuits to supply suits)

Relationships/Data Flow:
1. BepInEx starts the game → loads MoreSuits.dll
2. MoreSuits on Awake/Start reads its config file (x753.More_Suits.cfg)
3. Plugin enumerates /moresuits folder for PNG assets
4. For each PNG it checks for matching JSON in /advanced → parses metadata (emission, price, etc.)
5. Plugin registers new suit assets with Unity’s renderer via the HD Lit Shader API
6. At store load time, plugin injects purchasable suits based on “PRICE” in JSON
7. Game UI reflects new suits, users select them at runtime

##### Architectural patterns and design principles
- Plugin architecture via BepInEx (inversion of control: BepInEx calls your code)
- File-based extensibility: scanning directory for user content
- Convention over configuration: folder names (“moresuits”, “advanced”) and naming (matching PNG↔JSON)
- Lightweight, single-responsibility plugin – all logic in one DLL

- Clear component labels (e.g., “MoreSuits.dll”)
- Annotations for key technologies:
- BepInEx plugin framework (C# .NET 4.x)
- Unity HD Lit Shader (for emission)
- File I/O (PNG, JSON, TXT)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Runtime Environment"
        UE["Game + Unity Engine"]:::engine
        UI["Game UI"]:::engine
        UE -->|"Display Suits"| UI
    end

    BL["BepInEx Loader"]:::loader
    BL -->|"Load Plugin"| PL

    PL["MoreSuits Plugin\n(MoreSuits.dll)"]:::plugin
    PL -->|"Read/Write config"| C
    PL -->|"Scan PNGs"| MF
    PL -->|"Parse JSON"| ADV
    PL -->|"Inject Shader\n(HD Lit API)"| UE

    C["Config File\n(x753.More_Suits.cfg)"]:::config

    MF["/moresuits\n(PNG assets)"]:::assets
    ADV["/advanced\n(JSON metadata)"]:::assets

    LS["!less-suits.txt\n(Override)"]:::assets
    LS -->|"Override suits"| PL

    ThirdParty["External Mod Packages"]:::ext
    ThirdParty -->|"Depend on Plugin"| PL

    subgraph "Documentation"
        README["README.md"]:::docs
        CHANGELOG["CHANGELOG.md"]:::docs
        LICENSE["LICENSE"]:::docs
    end

    classDef engine fill:#ADD8E6,stroke:#000;
    classDef loader fill:#90EE90,stroke:#000;
    classDef plugin fill:#FFFF99,stroke:#000;
    classDef assets fill:#D3D3D3,stroke:#000;
    classDef config fill:#FFA500,stroke:#000;
    classDef ext fill:#FFB6C1,stroke:#000;
    classDef docs fill:#E0E0E0,stroke:#000;

    click PL "https://github.com/x753/lethal-company-more-suits/blob/main/MoreSuits.cs"
    click README "https://github.com/x753/lethal-company-more-suits/blob/main/README.md"
    click CHANGELOG "https://github.com/x753/lethal-company-more-suits/blob/main/CHANGELOG.md"
    click LICENSE "https://github.com/x753/lethal-company-more-suits/tree/main/LICENSE"
```
