# arnavkucheriya/initialdrift architecture

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

- Interactive diagram: https://gitdiagram.com/arnavkucheriya/initialdrift
- Repository: https://github.com/arnavkucheriya/initialdrift

## Overview

##### Project type and purpose
- This is a Unity-based Open Track drifting game (“Initial Drift”) built for WebGL deployment.
- The goal is to simulate real-time car physics in a browser, loading 3D models, materials, textures, audio, and running C# scripts via the Unity engine.

##### File structure
- Build/… contains the compiled WebGL output: .data (assets bundle), .framework.js (runtime loader), .loader.js (bootstrapper), .wasm (web assembly core).
- index.html and TemplateData/style.css are the hosting page and styling for the Unity canvas.
- Car Models/… holds FBX sources, material definitions, textures for each vehicle.
- Scripts/… holds all C# behaviour scripts (CarAudio, CarCam, CarDamage, etc.).
- StreamingAssets/UnityServicesProjectConfiguration.json for any runtime configuration.
- Images/… contains in-README screenshots; LICENSE and README.md describe the project.

##### README for additional insights
- No external services or server-side code—purely a client-side WebGL game.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Web Layer
    subgraph "Web Layer"
        WebServer["Static File Host"]:::web
        Browser["Web Browser / User Agent"]:::web
        index["index.html"]:::web
        styleNode["style.css"]:::web
    end

    %% Unity Runtime Layer
    subgraph "Unity Runtime Layer"
        loader["Initial Drift.loader.js"]:::web
        framework["Initial Drift.framework.js"]:::web
        wasm["Initial Drift.wasm"]:::web
        data["Initial Drift.data"]:::assets
        Engine["Unity Engine"]:::engine
        Rendering["Rendering Pipeline"]:::engine
        Physics["Physics Engine (PhysX)"]:::engine
        InputSys["Input Manager"]:::engine
        AudioSys["Audio System"]:::engine
    end

    %% Content Layer
    subgraph "Content Layer"
        Assets3D["3D Models & Materials"]:::assets
        subgraph "C# Game Logic Scripts"
            WheelController["WheelController.cs"]:::script
            WheelAlignment["WheelAlignment.cs"]:::script
            WheelSkid["WheelSkid.cs"]:::script
            Skidmarks["Skidmarks.cs"]:::script
            SpeedCalculator["SpeedCalculator.cs"]:::script
            CarDamage["CarDamage.cs"]:::script
            CarAudio["CarAudio.cs"]:::script
            CarCam["CarCam.cs"]:::script
            LightController["LightController.cs"]:::script
        end
        Config["UnityServicesProjectConfiguration.json"]:::assets
        subgraph "Documentation & Licensing"
            README["README.md"]:::doc
            LICENSE["LICENSE"]:::doc
        end
    end

    %% Connections
    WebServer --> Browser
    Browser --> index
    Browser --> styleNode
    index --> loader
    styleNode --> index
    loader --> framework
    loader --> wasm
    framework --> Engine
    wasm --> Engine
    Engine --> data
    data --> Assets3D
    Assets3D --> Engine
    Engine --> Rendering
    Engine --> Physics
    Engine --> InputSys
    Engine --> AudioSys
    Engine --> Config

    InputSys --> WheelController
    InputSys --> WheelAlignment
    InputSys --> WheelSkid
    InputSys --> Skidmarks
    InputSys --> SpeedCalculator
    InputSys --> CarDamage

    WheelController --> Physics
    WheelAlignment --> Physics
    WheelSkid --> Physics
    Skidmarks --> Physics
    SpeedCalculator --> Physics
    CarDamage --> Physics

    CarAudio --> AudioSys
    CarCam --> Rendering
    LightController --> Rendering

    %% Click Events
    click index "https://github.com/arnavkucheriya/initialdrift/blob/main/index.html"
    click styleNode "https://github.com/arnavkucheriya/initialdrift/blob/main/TemplateData/style.css"
    click loader "https://github.com/arnavkucheriya/initialdrift/blob/main/Build/Initial Drift (WebGL).loader.js"
    click framework "https://github.com/arnavkucheriya/initialdrift/blob/main/Build/Initial Drift (WebGL).framework.js"
    click wasm "https://github.com/arnavkucheriya/initialdrift/blob/main/Build/Initial Drift (WebGL).wasm"
    click data "https://github.com/arnavkucheriya/initialdrift/blob/main/Build/Initial Drift (WebGL).data"
    click Assets3D "https://github.com/arnavkucheriya/initialdrift/tree/main/Car Models/"
    click WheelController "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/WheelController.cs"
    click WheelAlignment "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/WheelAlignment.cs"
    click WheelSkid "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/WheelSkid.cs"
    click Skidmarks "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/Skidmarks.cs"
    click SpeedCalculator "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/SpeedCalculator.cs"
    click CarDamage "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/CarDamage.cs"
    click CarAudio "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/CarAudio.cs"
    click CarCam "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/CarCam.cs"
    click LightController "https://github.com/arnavkucheriya/initialdrift/blob/main/Scripts/LightController.cs"
    click Config "https://github.com/arnavkucheriya/initialdrift/blob/main/StreamingAssets/UnityServicesProjectConfiguration.json"
    click README "https://github.com/arnavkucheriya/initialdrift/blob/main/README.md"
    click LICENSE "https://github.com/arnavkucheriya/initialdrift/tree/main/LICENSE"

    %% Styles
    classDef web fill:#bbdefb,stroke:#333,stroke-width:1px
    classDef engine fill:#c8e6c9,stroke:#333,stroke-width:1px
    classDef assets fill:#ffe0b2,stroke:#333,stroke-width:1px
    classDef script fill:#fff59d,stroke:#333,stroke-width:1px
    classDef doc fill:#e0e0e0,stroke:#333,stroke-width:1px
```
