🛡️ Architecture Guard
The Architecture Guard is the enforcement engine that turns Nexus Graph from a “nice to have” into a “must-have”.
The Problem
In standard Unity development, it is too easy to create bad dependencies:
- A
PlayerControllerreferencingMainMenuUI(Core -> UI). - A
GameManagerreferencingEditorscripts (Build Breaker). - A 5KB Prefab referencing a 4K Texture (Memory Bloat).
The Solution: Active Protection
Nexus Graph includes a SaveGuard system that intercepts your work efficiently.
How SaveGuard Works (Internals)
Unlike other tools that require a “Full Project Scan” (taking minutes), SaveGuard runs locally on the specific asset you are modifying.
- Trigger: You press
Ctrl + S. - Scan: SaveGuard extracts the dependencies of the dirty asset in memory.
- Validate: It compares these dependencies against your Active Rule Set.
- Enforce:
- Warning Mode: Logs a warning but allows the save.
- Strict Mode: BLOCKS THE SAVE and shows a dialog explaining the violation.
“It’s like having a Senior Architect pair-programming with you 24/7.”
Configuration
You can toggle modes directly from the toolbar: Tools > Nexus Graph > Guard > [Toggle Strict Mode]
Rule Examples
| Source | Target | Reason | | :— | :— | :— | | .*Core.* | .*UI.* | Separation of Concerns. Core logic should be testable without UI. | | .* | .*Resources.* | Memory Safety. Prevents usage of the inefficient Resources folder. | | .*Game.* | .*Editor.* | Build Safety. Ensures no editor-only scripts leak into runtime code. |
Passive Validation
You can also run a full project audit at any time:
- Open the Graph Window.
- Click Check Rules.
- Receive a detailed report of all 100+ violations in legacy projects.