UGTK / Toolkit / Utility Systems / UGTK Assembly Manager Completed
Assembly Build Selector
Summary
The Assembly Build Selector (UGTK Assembly Manager) is an editor macro-tool that keeps your
builds lean: it includes in the build only the UGTK modules actually used and applies
per-platform optimal Player/Build settings. It is the single entry point for all build
optimization, organized into tabs by competence.
Content
Modules Dependencies
- Database System: stores per-scene optimization configurations (
SO_SceneOptimizationConfigDatabase).
The tool is Editor-only and never ships in the player build.
Setup
Open it from the menu UGTK > Assembly Build Selector. No scene setup is required.
No GIF on purpose. Every button in this window rewrites project-wide state — define constraints on the asmdefs, scripting defines on all build targets, Player Settings — so it is not something to drive just to record a demo. Open it and read the tabs: the window explains itself, and the confirmation dialog always lists exactly what is about to change before anything is applied.
How To Use
The window is organized in four tabs:
- Moduli in build — pick which assemblies end up in the build. Analyze one or more scenes
(or all Build Settings scenes) to auto-detect used modules; optionally scan
Resources/; mark a module with the 🔒 (force-keep) to always include it; then Apply. A confirmation lists exactly which assemblies will be excluded. Under the hood, each optimizable asmdef gets anINCLUDE_<name>define constraint and the active tokens are written as scripting defines to every build target and Unity 6 Build Profile. - Player Settings — reusable per-platform optimization profiles (
SO_UGTKBuildProfile) for WebGL / Android / Desktop: scripting backend, managed stripping, IL2CPP code generation, engine code stripping, WebGL compression/exceptions, Android architectures/AAB/texture format. Create default profiles, Validate (current vs profile) and Apply with one click. - Distribuzione — Prepara per distribuzione strips all
INCLUDE_*constraints/defines and deletes.bakfiles so anyone cloning the repo builds out-of-the-box; plus Re-sync defines and Restore backups. - Avanzate — scan roots and memory readout.
A load-time guard (AssemblyManagerImportGuard) automatically re-enables all modules if it detects
INCLUDE_* constraints without the matching defines (the "freshly cloned, not yet configured" state),
preventing CS0234/CS0246 errors.
Testing Scene
This is an editor tool: there is nothing to play. Test it from the UGTK > Assembly Build Selector window.
What to do, in order:
- Press Add current scene, then Analyze selected scenes. Nothing is written: the tool reports how many assemblies the scene really uses and how many end up enabled once their dependencies are counted, and those two numbers are usually very far apart.
- Select the assemblies a scene needs and save the configuration.
- Apply it and check the project still compiles.
- Build a player and compare its size with an unfiltered build.
- Switch build profile and confirm the defines are re-applied.
Step 3 is where it goes wrong: excluding an assembly something still references breaks the compile, and the error names the missing type rather than the assembly you switched off. Step 4 is the only measurement that tells you whether the exercise was worth it.
Opening the window used to strip the Editor platform lock from every asmdef under
Assets/. The routine that keeps always-on assemblies buildable also clearedincludePlatforms: ["Editor"], which is how an Editor assembly declares that it must never reach a player build. Eighteen of them were rewritten the moment the window appeared. It no longer touches platform locks at all: the assemblies it runs on are the ones it never switches off, so that lock was always authored on purpose.
Technical Info
- AssemblyManagerWindow: the macro-tool window (module include/exclude, scene analysis, per-platform profiles, distribution, apply logic).
- SO_SceneOptimizationConfigDatabase: database of per-scene optimization configs (which assemblies a scene needs).
- SO_UGTKBuildProfile: reusable per-platform (WebGL/Android/Desktop) build optimization profile.
- AssemblyManagerImportGuard:
[InitializeOnLoad]guard that keeps the project always buildable. - AssemblyManagerBuildProfileSync: re-applies the active INCLUDE_ defines when the Unity 6 Build Profile changes.
© 2026 Marcello De Bonis. All rights reserved
Depends on 1
Used by 0
- No other module depends on it.
Measured from the repository: code references (asmdef) plus prefab and asset GUIDs. Importing this module alone brings in 3 modules in total.
UGTKengine within an engine


