Unity Editor Tool

SceneXRay

Editor-only · no dependencies

See every dependency in your scene — serialized references, UnityEvent targets, ScriptableObjects and materials — as an interactive graph you can drill into, arrange and keep. Plus missing-reference detection, dependency cycles, a health score and a build guard for CI.

47
Scripts
10.1k
Lines
20
EditMode tests
0
External deps
6
Export formats
Overview
Features

Everything runs in the editor. Nothing is compiled into your build, no runtime component is added to any scene, and no package needs installing.

Dependency graph
GraphView canvas of the loaded scenes. Nodes are objects and assets, edges are references.
Core
Drill-in focus
Double-click for the ego network of a node. Radius 1–3, direction In / Out / Both.
Core
Browser navigation
Back / Forward restore camera, page and layout. Breadcrumbs jump to any level.
Core
Neighborhood highlight
Hover a node: neighbours light up, outgoing edges amber, incoming cyan, the rest dims.
Four layouts
Auto, Tree, Force and Radial — switched from the toolbar, remembered per user.
Saved arrangements
Arrange the graph your way and keep it per scene, auto-restored on open.
New
Undo / Redo
32 steps of node moves and re-layouts, on the standard Ctrl+Z / Ctrl+Y.
New
Zoom LOD
Cards drop detail and grow their titles as you zoom out — still readable at 20%.
Health score
Missing references, dependency cycles and god objects, scored live in the toolbar.
Fix Missing
Every broken reference in one list, with best-effort rebinding by name.
Inspector strip
References / Referenced By cards on GameObjects, prefab assets and ScriptableObjects.
Scene overlay
Dependency lines drawn in the Scene View, colour-coded by link type.
Global search
Find what references any object, across loaded scenes and the project.
Bookmarks
Pin objects and jump back later. Ctrl+Shift+Alt+J to toggle, +K to open the list.
Scene diff
Compare the dependency links of two scene assets without leaving them open.
Code dependencies
Optional scan for generic component lookups, object names and tags used in C#.
Export
JSON, CSV, self-contained interactive HTML, Mermaid and Markdown.
Build guard + CLI
Quality gates in batchmode with a non-zero exit code when the scene is broken.
Localization
English and Ukrainian, switched in Project Settings.
EN / UA
Getting started
Install

Copy one folder. There is no bootstrap call, no scene setup and no package manifest to edit.

1
Drop the folder in
Copy SceneXRay/ anywhere under Assets/. It ships its own assembly definition, so it compiles on its own and never leaks into your runtime assemblies.
2
Open the graph
Tools ▸ SceneXRay ▸ Open Graph View or Ctrl+Shift+Alt+X. The shortcut is rebindable under Edit ▸ Shortcuts ▸ Main Menu.
3
Press Refresh
Every loaded scene is scanned. Large scenes are paged — raise Max Nodes In Graph in settings if you want more per page.
Requirements: Unity 6000.0 LTS (Unity 6) or newer (verified on Unity 6000.0.62f1 and 6000.5.6f1). No packages, no third-party libraries, no runtime footprint.
Getting started
First run

The window opens on the full graph of the loaded scenes. From there you drill in.

Typical loop
// 1. Something is wrong with an object — find it Select it in the Hierarchy → press Enter in the graph // 2. See exactly who touches it Direction In → everything that references it Direction Out → everything it depends on Radius 2 → one more hop in each direction // 3. Follow the chain Double-click a neighbour → it becomes the new center Backspace → back, with the camera exactly where you left it
Follow mode in the toolbar keeps the graph focused on whatever you select in the Hierarchy — useful while debugging, noisy while exploring.
Graph
Controls

Everything is reachable from the keyboard; the status bar at the bottom always shows the current bindings, node counts and zoom.

InputAction
Double-click / EnterFocus the node — show its ego network
Backspace / Alt+Back to the previous view (camera and layout restored)
Alt+Forward
EscUp one level — back, or out of focus into the full graph
= / Grow / shrink the focus radius (1–3 hops)
Move the selection between cards, camera follows
Ctrl+wheelZoom · MMB drag or Alt+drag pan
A / FFit everything / frame the selection
0Reset zoom to 100%
Ctrl+Z / Ctrl+YUndo / redo node arrangement
Ctrl+SSave this scene's arrangement
Ctrl+FJump to the search field
Right-clickFocus · expand · select in Hierarchy/Project · view references · find missing
Selecting a node selects the underlying object in the Hierarchy — or pings the asset in the Project window — so the Inspector always follows what you are looking at.
Graph
Focus & history

Focus replaces the full graph with the neighbourhood of one object. History behaves like a browser: every step remembers its camera, page and focus parameters.

ControlMeaning
R (1–3)How many hops away from the center to include
Dir · BothUndirected neighbourhood — everything connected
Dir · OutOnly what the center depends on
Dir · InOnly what references the center
BreadcrumbsAll › Player › Weapon — click any level to jump straight back
Show AllLeave focus, restoring the full-graph arrangement you had
Focus works on assets too. Drill into a ScriptableObject or material node to see every scene object that pulls it in — the same Enter / radius / direction controls apply.
Graph
Layouts

The Layout menu picks how nodes are placed. The choice is remembered per user, and Re-layout now re-runs it on whatever is on screen.

ModeBest for
AutoDefault — Tree for the full graph, Radial while focused
TreeReading direction: layered left→right columns by dependency depth, barycenter-ordered rows
ForceDense scenes: keeps the columns but hard-packs rows so nothing overlaps
RadialOne object under investigation: rings by hop distance around the center
Graph
Saved arrangements

Automatic layouts are a starting point. Once you have dragged the graph into the shape that matches how you think about the scene, keep it.

Menu · LayoutWhat happens
Save my layout Ctrl+SStores every node position for the active scene
Restore my layoutRe-applies it — nodes added since keep their computed position
Auto-restore on openOn by default: reopening the scene brings your arrangement back
Delete saved layoutForget it and fall back to automatic layouts
Where it lives: UserSettings/SceneXRay/Layouts/<sceneGUID>.json — personal editor state, outside Assets/ and outside version control, and unlike Library/ it survives a reimport. Positions are keyed by GlobalObjectId (scene objects) and asset GUID, so they stick across rebuilds of the graph.
Graph
Reading the graph

Colour carries the link type; position carries the direction; hovering carries the detail.

Direct reference
UnityEvent
Asset reference
Missing reference
Hovered — outgoing
Hovered — incoming
On the cardMeaning
Icon + nameThe object or asset the node stands for
Second lineHierarchy path (or asset folder) — disambiguates same-named objects
Blue badgeNumber of links touching this node
Left colour barHierarchy root the object belongs to
Amber ringCurrent focus center
Layouts run left → right: a node's dependencies sit to its right, the things that reference it to its left. Hover any card to colour its outgoing and incoming edges differently.
Analysis
What gets scanned

Every serialized ObjectReference on every component of every GameObject in the loaded scenes, including fields hidden from the Inspector, plus persistent UnityEvent targets found through reflection.

Link typeSourceExample
Directserialized GameObject / Component fieldPlayerController.visualRoot → Visual
UnityEventpersistent listener target + methodButton.m_OnClick → GameManager.Restart()
Assetany referenced project assetMeshRenderer → M_Player
Missingreference whose target no longer existsSpawner.target → Missing
In codeopt-in C# lookup by type, name or tagHUD → FindWithTag("Player")

Noise control

RuleWhy
Ignored ComponentsTransform, RectTransform by default — parenting is not a dependency
m_Script skippedEvery MonoBehaviour points at its own script asset; the component name is already on the link
Self-references skippedButton.targetGraphic → Image on the same object is not a link between objects
Built-ins excludedOpt in with Include Built-in Assets if you want Default-Material and friends
Prefabs. The Prefabs toggle also scans the prefab assets used by instances in the loaded scenes, so a prefab's own internal wiring and its material / clip references show up in the same graph.
Code scan limitations. The optional code pass is a fast text analysis, not a Roslyn compilation. It detects literal generic lookups, object names and tags, but not reflection, dependency-injection bindings, generated code, aliases or dynamically assembled strings. Broad lookups are capped to avoid unreadable edge floods.
Analysis
Health & missing references

The score in the toolbar is a single number for "is this scene wired sanely". Click it for the breakdown.

SignalMeaning
Missing referencesSerialized fields pointing at deleted objects — the usual cause of null-refs at runtime
CyclesA → B → C → A dependency loops, listed with the full path
God objectsObjects with more than 10 links — the usual refactor candidates

Fix Missing

Tools ▸ SceneXRay ▸ Fix Missing lists every broken reference with its component and property. Selecting a row pings the object; Fix All rebinds each one to a scene object whose name matches the property name, which resolves the common "renamed the object, lost the link" case. Everything it changes goes through Undo.

Fixing is best-effort by name. Review the result — it is a starting point, not a guarantee.
Analysis
Inspector strip

The fastest answer to "who uses this?" without leaving the Inspector. Enabled by default, toggled in settings.

SelectedYou get
Scene GameObjectReferences — what it points at · Referenced By — what points at it
Prefab assetWhat the whole prefab tree references, plus the scene objects using the prefab
ScriptableObject / materialReferenced By — every scene object that pulls the asset in
Each row is a chip: click it to select that object. The Graph action opens the graph focused on the thing you are inspecting. Reads come from an incremental reverse index that rebuilds in ~8 ms time slices, so browsing the Project window stays cheap.
Analysis
Scene diff & export

Compare two scene assets structurally, or take the current graph into documentation and tooling.

CommandResult
Advanced ▸ Scene DiffCompares the dependency links of two scene assets without opening them
ExportJSON · CSV · self-contained interactive HTML · Mermaid · Markdown
Mermaid and Markdown output drop straight into a README or a wiki page — handy for documenting how a scene is wired without screenshots that go stale.
Reference
Settings

Project Settings ▸ SceneXRay. Stored in ProjectSettings/SceneXRaySettings.asset, so the team shares them.

GroupSettingEffect
OverlayEnable / AnimateDependency lines drawn in the Scene View for the selected object
ColorsDirect · UnityEvent · Missing · Asset · In Code · Line WidthApplies to both the overlay and the graph edges, live — no refresh needed
InspectorInspector IntegrationThe References / Referenced By strip
GraphMax Nodes In GraphPage size for very large scenes
ScanningIgnored ComponentsComponent types the scanner skips entirely
ScanningScan Asset ReferencesRecord links to project assets (materials, clips, ScriptableObjects…)
ScanningInclude Built-in AssetsAlso record Unity's built-ins — noisy, off by default
ScanningScan Code DependenciesOpt-in C# lookup scan; off by default because it reads script source files
ScanningMax Code Targets · Script NodesCaps broad lookups and controls whether referenced classes appear as cards
BuildBuild Guard · Fail Build On Missing RefsBlock a build when the scene has broken references
LanguageEnglish / УкраїнськаEditor UI language
Changing a Scanning setting invalidates the cache, rebuilds the reference index and refreshes the graph immediately — what you see always matches what is configured.
Reference
CI / batchmode

Run the same analysis headlessly and fail the pipeline on broken wiring.

Command
Unity -batchmode -quit -projectPath . \ -executeMethod SceneXRay.Editor.Core.CommandLine.ScanScene \ -scene Assets/Scenes/Main.unity \ -output dependencies.json
BehaviourDetail
OutputEvery link as JSON: source path, target, property, component, link type
Exit code0 clean · 1 when a quality gate fails or the scene is missing
Build guardOff by default. Enable Build Guard to scan before a build: interactive builds ask for confirmation, batchmode fails only when Fail Build On Missing Refs is on
Reference
Architecture

Two editor-only assemblies, four namespaces, no external references.

SceneXRay/ ├── Editor/ │ ├── Core/ SceneXRay.Editor.Core — scanning, index, analysis, storage │ │ SceneScanner · PrefabScanner · XRayReferenceIndex · XRayAnalyzer │ │ XRayLayoutStore · XRayCacheManager · CodeDependencyScanner · XRayBookmarks │ │ QualityGate · BuildGuard · CommandLine · SceneXRaySettings │ ├── UI/ SceneXRay.Editor.UI — graph canvas and editor UI │ │ XRayVirtualGraphView (+ XRayGraphInteraction) · XRayNode · XRayEdge │ │ XRayInspectorIntegration · XRayOverlay · XRayHealthScoreUI · XRayLocalization │ ├── Windows/ SceneXRay.Editor.Windows — EditorWindows │ │ XRayWindow · GlobalSearch · Bookmarks · References · FixMissing · SceneDiff · Tutorial │ ├── Exporters/ SceneXRay.Editor.Exporters — JSON/CSV/HTML/Mermaid/MD │ ├── Styles/ XRayStyles.uss — dark + light skins │ └── SceneXRay.Editor.asmdef └── Tests/Editor/ SceneXRay.Editor.Tests — EditMode tests
AssemblyPlatformsReferences
SceneXRay.EditorEditor onlynone · autoReferenced: false
SceneXRay.Editor.TestsEditor onlySceneXRay.Editor · gated by UNITY_INCLUDE_TESTS

Where data is written

PathContent
ProjectSettings/SceneXRaySettings.assetShared team settings
UserSettings/SceneXRay/Layouts/Your saved graph arrangements
Library/SceneXRay/Scan cache and bookmarks
Nothing SceneXRay writes ends up in version control, and nothing is written into Assets/ at runtime.
Reference
Public API

The tool is UI-first, but the scanning and graph layers are plain static classes you can drive from your own editor scripts.

Scanning
using SceneXRay.Editor.Core; // One object, the loaded scenes, or a prefab tree List<DependencyLink> links = SceneScanner.ScanGameObject(go); List<DependencyLink> all = SceneScanner.ScanAllGameObjects(); List<DependencyLink> pf = PrefabScanner.ScanPrefab(prefabAsset); // Reverse index — cached, never scans on read var incoming = XRayReferenceIndex.GetIncoming(go); var outgoing = XRayReferenceIndex.GetOutgoing(go); var users = XRayReferenceIndex.GetIncomingForAsset(scriptableObject); // Health report: score, missing, cycles, god objects HealthReport report = XRayAnalyzer.Analyze(all);
Opening the graph from your own tool
using SceneXRay.Editor.Windows; XRayWindow.ShowWindow(); // just open it XRayWindow.ShowWindowFocused(gameObject); // open focused on an object XRayWindow.ShowWindowFocusedAsset(scriptableObject); // …or on an asset
Driving the graph view
var graph = EditorWindow.GetWindow<XRayWindow>().GraphView; graph.FocusOn(go, radius: 2, direction: FocusDirection.Incoming); graph.FocusOnAsset(asset); graph.SetLayoutMode(XRayLayoutMode.Radial); graph.SaveLayout(); graph.RestoreLayout(); graph.UndoLayoutChange(); graph.FrameGraph(); // fit everything, animated
Reference
Troubleshooting
SymptomCause / fix
Graph is emptyPress Refresh. If the scene really has no serialized cross-references there is nothing to draw — check with Selected Only off.
Ctrl+Shift+Alt+X does nothingSomething else in the editor has claimed the chord. Rebind it under Edit ▸ Shortcuts ▸ Main Menu ▸ Tools/SceneXRay/Open Graph View; the menu item itself always works.
Materials / SOs are missing from the graphScan Asset References is off, or the asset is a Unity built-in — enable Include Built-in Assets.
Too many nodes to readFocus an object instead of showing all, lower Max Nodes In Graph, or filter by link type.
Layout keeps resettingSave it: Layout ▸ Save my layout and keep Auto-restore on open enabled.
Inspector strip missingInspector Integration is off in settings, or the object has no links.
Stale data after editing the sceneEnable Live Mode, or press Refresh — the index rebuilds on a debounce.