# tonyvit/curvedtextmeshpro architecture

> Architecture diagram of the GitHub repository tonyvit/curvedtextmeshpro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tonyvit/curvedtextmeshpro
- Repository: https://github.com/tonyvit/curvedtextmeshpro

## Overview

##### Project type and purpose
- This is a Unity plugin (“CurvedTextMeshPro”) that extends the TextMesh Pro package.
- Purpose: provide scripts that curve 2D text along mathematical functions (circle arcs, exponential curves or any custom function).

##### File structure
- Top-level folders:
- Assets/CurvedTextMeshPro
– Scenes/DemoScene.unity (demo usage)
– Scripts/TextProOnACurve.cs (abstract base)
– Scripts/TextProOnACircle.cs, TextProOnAExp.cs (concrete subclasses)
- Assets/TextMesh Pro/... (embedded TextMesh Pro resources: shaders, fonts, materials, docs)
- Packages/manifest.json (Unity Package Manager)
- ProjectSettings/… (standard Unity configuration)
- Key patterns:
- OOP inheritance: TextProOnACurve ← TextProOnACircle & TextProOnAExp
- Plugin architecture: self-contained under Assets/CurvedTextMeshPro
- Demo Scene illustrates end-to-end data flow

##### README for additional insights
- Describes plugin usage: copy folder, attach one of the provided scripts, or subclass TextProOnACurve for custom curves.
- Highlights dependencies: Unity 2018.3.6f1, TextMesh Pro.
- No runtime servers or databases—purely a client-side rendering plugin.

##### Diagramming conventions
- From Unity Engine → plugin scripts (execution callbacks)
- From plugin → TextMesh Pro API (mesh updates)
- From user scene/game objects → plugin components
- Blue for Unity core (Engine, Editor)
- Green for third-party dependency (TextMesh Pro)
- Orange for plugin code (CurvedTextMeshPro folders/scripts)

##### Detailed element checklist
- Interfaces/callbacks: e.g., “OnEnable()/Update() hook”
- Class hierarchy inset: base vs subclasses
- DemoScene as the consumer of the plugin

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Unity Core
    subgraph "Unity Environment"
        Editor["Unity Editor"]:::unity
        Engine["Unity Engine"]:::unity
    end

    %% Third-party Dependency
    TMP["TextMesh Pro"]:::thirdparty

    %% Plugin Components
    subgraph "CurvedTextMeshPro Plugin"
        Core["TextProOnACurve"]:::plugin
        Circle["TextProOnACircle"]:::plugin
        Exp["TextProOnAExp"]:::plugin
        Demo["DemoScene"]:::plugin
    end

    %% Project Metadata
    subgraph "Project Meta"
        Manifest["manifest.json"]:::docs
        Settings["ProjectSettings"]:::docs
        Readme["README.md"]:::docs
        License["LICENSE"]:::docs
    end

    %% Relationships
    Editor -->|"opens scene"| Demo
    Demo -->|"instantiates scripts"| Core
    Circle -->|"inherits from"| Core
    Exp -->|"inherits from"| Core
    Core -->|"uses mesh API"| TMP
    TMP -->|"renders mesh"| Engine
    Manifest -->|"declares dependency"| TMP
    Settings -->|"configures plugin"| Demo

    %% Click Events
    click Core "https://github.com/tonyvit/curvedtextmeshpro/blob/master/CurvedTextMeshPro/Assets/CurvedTextMeshPro/Scripts/TextProOnACurve.cs"
    click Circle "https://github.com/tonyvit/curvedtextmeshpro/blob/master/CurvedTextMeshPro/Assets/CurvedTextMeshPro/Scripts/TextProOnACircle.cs"
    click Exp "https://github.com/tonyvit/curvedtextmeshpro/blob/master/CurvedTextMeshPro/Assets/CurvedTextMeshPro/Scripts/TextProOnAExp.cs"
    click Demo "https://github.com/tonyvit/curvedtextmeshpro/blob/master/CurvedTextMeshPro/Assets/CurvedTextMeshPro/Scenes/DemoScene.unity"
    click TMP "https://github.com/tonyvit/curvedtextmeshpro/tree/master/CurvedTextMeshPro/Assets/TextMesh Pro"
    click Manifest "https://github.com/tonyvit/curvedtextmeshpro/blob/master/CurvedTextMeshPro/Packages/manifest.json"
    click Settings "https://github.com/tonyvit/curvedtextmeshpro/tree/master/CurvedTextMeshPro/ProjectSettings"
    click Readme "https://github.com/tonyvit/curvedtextmeshpro/blob/master/README.md"
    click License "https://github.com/tonyvit/curvedtextmeshpro/tree/master/LICENSE"

    %% Styles
    classDef unity fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef thirdparty fill:#90EE90,stroke:#333,stroke-width:1px
    classDef plugin fill:#FFA500,stroke:#333,stroke-width:1px
    classDef docs fill:#D3D3D3,stroke:#333,stroke-width:1px
```
