# knela96/dynamic-parkour-system architecture

> Architecture diagram of the GitHub repository knela96/dynamic-parkour-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/knela96/dynamic-parkour-system
- Repository: https://github.com/knela96/dynamic-parkour-system

## Overview

##### Main Components
- Unity Engine & Dependencies – Note that the package requires Unity’s own environment, along with external packages like Cinemachine and the Input System.
- Editor Interface – Under Assets/Dynamic Parkour System/Editor, these scripts (e.g., EditorHandler.cs) are responsible for providing custom editor tooling.
- Core Modules and Subsystems:
- Character Controller & Player Input: This is represented by scripts in Helpers/Player (PlayerControls.cs and the associated input action asset) and System Controllers (e.g., InputCharacterController.cs, ThirdPersonController.cs, MovementCharacterController.cs).
- Animation & Model: The Model folder houses numerous .fbx animation files, the Animator Controller, and textures. The AnimationCharacterController in System Controllers coordinates with these assets.
- Vaulting and Climbing Actions: The Vaulting Actions folder (and the vault-related system controllers) defines the discrete parkour actions (Vault, Slide, Jump, etc.), while Helper scripts (in Action Base Scripts and Climbing directories) provide foundational logic.
- Camera Handling: Scripts under Helpers/Camera (e.g., SwitchCameras.cs) and CameraController.cs work together with Cinemachine to manage camera transitions between parkour actions.
- Environment Interactions: The Prefabs directory (Environment subfolders for Climb, Jump, Vault, etc.) contains interactive objects (jump points, ledges, obstacles) that the system uses to trigger parkour behaviors.
- Resources/Configurations: Under the Resources, you have ActionsConfig for parkour parameters and Materials for visual consistency.

##### Relationships and Data Flow
- User Input (from Keyboard/Mouse or Gamepad) → Input System (via the PlayerControls.inputactions) → InputCharacterController.cs.
- The InputCharacterController then activates various System Controllers (Movement, Animation, Vaulting, Climb) based on user commands.
- The controllers query configured actions (from Resources/ActionsConfig) and interact with the Animator Controller (backed by the animations in the Model folder) to run parkour moves.
- The CameraController adjusts the view using components like Cinemachine.
- Prefabs, defined in the Environment folders, are placed into the scene to serve as interactable objects triggering specific behaviors (e.g., a Ledge prefab triggers ClimbController.cs).

##### Architectural Patterns and Design Principles
- Modular Separation: There is a clear division between core functionalities (character input, motion logic, animation handling, and parkour actions), adaptive to Unity’s component-based system.
- Extensibility: The usage of scriptable resource configurations (in Resources/ActionsConfig) and reusable prefabs makes it easy to extend or tweak parkour actions.
- Editor vs. Runtime: Custom editor scripts help configure game objects during design time while keeping out runtime overhead.

##### Relevant Technologies
- Unity Engine (with its Asset, Scene, and Prefab system).
- External packages: Unity's Cinemachine and Input System.
- C# scripting for game logic and custom editor extensions.
- Asset management via the Unity Package Manager.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Platform & Dependencies
    subgraph "Platform & Dependencies"
        UE["Unity Engine & External Dependencies"]:::engine
    end

    %% Editor Layer
    subgraph "Editor Layer"
        ET["Editor Tools"]:::editor
    end

    %% Application Layer
    subgraph "Application Layer"
        UI["User Input"]:::application
        PC["Player Controls"]:::input
        IC["Input Character Controller"]:::application
        MC["Movement Controller"]:::application
        AC["Animation Controller"]:::application
        VA["Vaulting Actions"]:::application
        CC["Climb Controller"]:::application
        CAMC["Camera Controller"]:::application
        SC["Switch Cameras"]:::application
    end

    %% Data & Assets Layer
    subgraph "Data & Assets Layer"
        AT["Animator Controller"]:::data
        EP["Environment Prefabs"]:::data
        RC["Resources & Configurations"]:::data
    end

    %% Connections
    UI -->|"sendsInput"| PC
    PC -->|"processesInput"| IC
    IC -->|"activates"| MC
    IC -->|"activates"| AC
    IC -->|"initiates"| VA
    IC -->|"initiates"| CC
    IC -->|"activates"| CAMC

    MC -->|"queries"| RC
    AC -->|"queries"| RC
    AC -->|"animates"| AT

    CAMC -->|"controls"| SC

    EP -->|"triggers"| CC
    VA -->|"configuredBy"| RC

    ET -->|"configures"| RC
    UE -->|"providesEnvFor"| IC

    %% Click Events
    click ET "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Editor/EditorHandler.cs"
    click PC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/Helpers/Player/PlayerControls.cs"
    click IC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/System Controllers/InputCharacterController.cs"
    click MC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/System Controllers/MovementCharacterController.cs"
    click AC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/System Controllers/AnimationCharacterController.cs"
    click AT "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Model/Animator Controller.controller"
    click VA "https://github.com/knela96/dynamic-parkour-system/tree/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/Vaulting Actions"
    click CC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/System Controllers/ClimbController.cs"
    click SC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/Helpers/Camera/SwitchCameras.cs"
    click CAMC "https://github.com/knela96/dynamic-parkour-system/blob/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Scripts/System Controllers/CameraController.cs"
    click EP "https://github.com/knela96/dynamic-parkour-system/tree/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Prefabs/Environment"
    click RC "https://github.com/knela96/dynamic-parkour-system/tree/main/Dynamic Parkour System/Assets/Dynamic Parkour System/Resources"

    %% Styles
    classDef engine fill:#f4d03f,stroke:#e67e22,stroke-width:2px;
    classDef editor fill:#8e44ad,stroke:#5e3370,stroke-width:2px;
    classDef application fill:#3498db,stroke:#2980b9,stroke-width:2px;
    classDef data fill:#27ae60,stroke:#1e8449,stroke-width:2px;
    classDef input fill:#f39c12,stroke:#e67e22,stroke-width:2px;
```
