# alexandregaudencio/unity-dialoguesystem architecture

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

- Interactive diagram: https://gitdiagram.com/alexandregaudencio/unity-dialoguesystem
- Repository: https://github.com/alexandregaudencio/unity-dialoguesystem

## Overview

##### Project type and purpose
- This is a Unity‐based plugin/extension project (“Unity-DialogueSystem”) that provides an editor workflow for building linear dialogue flows and a runtime framework to display dialogues with optional animations. It leverages Unity’s ScriptableObject data model, custom Editor windows, and runtime UI managers.

##### File structure
- Top‐level Unity folders:
- Assets/Plugins/DialogueSystem
– Editor/: custom windows, graph view, save/load utilities
– Runtime/: data structures (DSDialogueChoiceData, Enumerations), managers (DialogueSelector, DialogueUIManager)
– ScriptableObjects/: containers for dialogue assets
– Utilities/: file system, global variables
- Assets/Resources/Dialogues/: serialized dialogue graphs and group assets
- Assets/Resources/Animation & Plugins/Demigiant/DOTween/: animation data & tweening library
- Assets/Scenes/: sample scene demonstrating the system
- Assets/DivinityCodes/: unrelated “InspectMe” demo plugin
- Packages & ProjectSettings: standard Unity config

##### README for additional insights
- This fork removes multi-choice branching, improves usability/UX, fixes bugs, and adds new features. For original feature set, refer to the upstream repo.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Unity["Unity Engine Host"]:::external
    Scene["SampleScene"]:::external

    subgraph "DialogueSystem Editor Module"
        EditorModule["DialogueSystem Editor Module"]:::editor
        GraphEditor["DSGraphView"]:::editor
        SaveLoad["DSIOUtility"]:::editor
    end

    subgraph "Dialogue ScriptableObject Data Store"
        DataStore["Dialogue ScriptableObject Data Store"]:::data
        Container["DSDialogueContainerSO"]:::data
        Group["DSDialogueGroupSO"]:::data
        Dialogue["DSDialogueSO"]:::data
    end

    subgraph "DialogueSystem Runtime Module"
        RuntimeModule["DialogueSystem Runtime Module"]:::runtime
        Selector["DialogueSelector"]:::runtime
        GroupSelector["DialogueGroupSelector"]:::runtime
        UIManager["DialogueUIManager"]:::runtime
        MessageManager["MessageUIManager"]:::runtime
    end

    subgraph "Animation Layer"
        AnimController["DialogueAnimationController"]:::runtime
        DOTween["DOTween Library"]:::external
    end

    subgraph "Utilities"
        FileSys["FileSystemUtility"]:::editor
        Globals["GlobalVariables"]:::editor
    end

    Unity -->|hosts| Scene
    Scene -->|references UI| UIManager
    EditorModule -->|creates/edits| DataStore
    GraphEditor -->|creates/edits| Container
    SaveLoad -->|manages persistence| Container
    DataStore -->|loaded at runtime by| Selector
    Selector -->|drives| UIManager
    UIManager -->|invokes| AnimController
    AnimController -->|uses| DOTween
    UIManager -->|player input| Selector
    FileSys -->|utility for| EditorModule
    Globals -->|utility for| RuntimeModule

    click EditorModule "https://github.com/alexandregaudencio/unity-dialoguesystem/tree/main/Assets/Plugins/DialogueSystem/Editor"
    click GraphEditor "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Editor/Windows/DSGraphView.cs"
    click SaveLoad "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Editor/Utilities/DSIOUtility.cs"
    click DataStore "https://github.com/alexandregaudencio/unity-dialoguesystem/tree/main/Assets/Plugins/DialogueSystem/ScriptableObjects"
    click Container "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/ScriptableObjects/DSDialogueContainerSO.cs"
    click Group "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/ScriptableObjects/DSDialogueGroupSO.cs"
    click Dialogue "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/ScriptableObjects/DSDialogueSO.cs"
    click RuntimeModule "https://github.com/alexandregaudencio/unity-dialoguesystem/tree/main/Assets/Plugins/DialogueSystem/Runtime"
    click Selector "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Runtime/DialogueSelector.cs"
    click GroupSelector "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Runtime/DialogueGroupSelector.cs"
    click UIManager "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Runtime/UiManager/DialogueUIManager.cs"
    click MessageManager "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Runtime/MessageUIManager.cs"
    click AnimController "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueResources/DialogueAnimationController.controller"
    click DOTween "https://github.com/alexandregaudencio/unity-dialoguesystem/tree/main/Assets/Plugins/Demigiant/DOTween"
    click FileSys "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Utilitites/FileSystemUtility.cs"
    click Globals "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Plugins/DialogueSystem/Utilitites/GlobalVariables.cs"
    click Scene "https://github.com/alexandregaudencio/unity-dialoguesystem/blob/main/Assets/Scenes/SampleScene.unity"

    classDef editor fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef data fill:#DEFDE0,stroke:#228B22,color:#228B22;
    classDef runtime fill:#FFE4B5,stroke:#CD853F,color:#CD853F;
    classDef external fill:#E6E6FA,stroke:#8A2BE2,color:#8A2BE2;
```
