Skip to content

Afterix-Hub/BuildLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildLens — Build Size Analysis for Unity

Version: 1.0.0 Unity: 2022.3 LTS and above Editor-only. Zero runtime footprint.


Overview

BuildLens reads Unity's BuildReport and transforms it into an interactive analysis window. It answers the two questions every developer asks when a build is too large:

  1. What is taking up space? — Treemap visualization of every packed asset.
  2. Why is it in the build? — Full dependency chain tracing from any asset.

Installation

Option A — Copy into project

Copy the BuildLens/ folder into your project's Assets/ directory.

Option B — Unity Package Manager (local)

  1. In Unity, open Window > Package Manager
  2. Click +Add package from disk...
  3. Navigate to the BuildLens/package.json file and select it

Quick Start

  1. Run a player build (File > Build Settings > Build)
  2. Open BuildLens: Window > BuildLens > Open BuildLens
  3. Click ▶ Analyze in the top-right toolbar

BuildLens reads the most recent BuildReport from your project's Library/ folder. Analysis runs automatically after any successful build.


Tabs

Overview

The main analysis view. Shows:

  • Summary bar — platform, asset count, total compressed and uncompressed size
  • Treemap — all assets visualised as proportional rectangles; area = compressed size; colour = asset type
  • Asset list — sortable, filterable table of all packed assets

Interact with the treemap:

  • Click any rectangle to select the asset
  • The selected asset is highlighted in both the treemap and the list

Filter bar:

  • Toggle asset type categories (Texture, Mesh, Audio, etc.) on/off
  • Change sort order: Compressed Size / Uncompressed Size / Type / Name

Dependencies

Inspect the dependency chain of any selected asset.

  • Select an asset in the Overview tab first
  • Dependencies column — everything this asset depends on (forward chain)
  • Dependents column — everything that pulls this asset into the build (reverse/inclusion chain)
  • Depth control — limit traversal to 1 / 2 / 3 / Full levels deep

Warning: "Full" depth on a densely connected asset may return hundreds of nodes. A warning is shown above 200 results.

Click any dependency node to re-select it and pivot the view.

History

Compare build snapshots over time.

  • Every Analyze run saves a snapshot to BuildLensData/snapshots/
  • Set Baseline and Set Current on any two snapshots, then Compute Diff
  • Diff shows:
    • Added assets (green) — new to the current build
    • Removed assets (red) — present in baseline, absent in current
    • Changed assets (amber) — size changed between builds
    • Total size delta — at a glance in the toolbar

Pin a snapshot (★) to prevent it from being evicted. Up to 50 snapshots are retained.

About

  • BuildLens and Unity version info
  • Export JSON — full snapshot in schema-versioned JSON
  • Export CSV — flat asset table; importable into Excel, Google Sheets, etc.
  • Links for Documentation, Support, and Bug Report (URLs assigned post-launch)

Export

From the About tab:

Format Content
JSON Full BuildSnapshot — all asset nodes, metadata, schema version
CSV Flat table: GUID, path, type, compressed bytes, uncompressed bytes

Both formats are saved to a path you choose via a save dialog.


Snapshot Storage

Snapshots are saved to BuildLensData/ in your project root (same level as Assets/).

[ProjectRoot]/
└── BuildLensData/
    ├── index.json          ← Snapshot index (fast listing without full deserialization)
    └── snapshots/
        └── *.blsnapshot    ← One file per analysis run

Add BuildLensData/ to .gitignore unless you want to share snapshot history with your team.


Automatic Analysis

BuildLens installs a post-build hook (IPostprocessBuildWithReport). After any successful player build, analysis runs automatically and the BuildLens window updates.

To trigger manually: open the window and click ▶ Analyze.


Asset Type Colour Reference

Colour Type
🔵 Steel blue Texture
🟠 Amber Mesh
🟢 Green Audio
🟣 Purple Script
🔴 Red Shader
🩵 Teal AnimationClip
🟡 Yellow ScriptableObject
🩷 Pink Font
🔷 Indigo Video
⬜ Grey Other

Requirements

  • Unity 2022.3 LTS or above (tested on 2022.3, 2023.2, Unity 6000.0)
  • No third-party package dependencies
  • Windows, macOS, and Linux Editor supported

Known Limitations (v1.0.0)

  • Redundancy detection, compression advice, and budget enforcement are planned for v1.5.0
  • Addressables integration and headless CI mode are planned for v2.0.0
  • Uncompressed size for Mesh and Script asset types is estimated (labelled in the UI)
  • Analysis requires at least one player build to have been completed

Support

Documentation, Support, and Bug Report links are available in the About tab. URLs will be activated following the initial Asset Store release.

About

BuildLens is a production-focused Unity Editor tool that analyzes build reports to reveal asset sizes, dependency graphs, and build history insights with visual breakdowns.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages