Using RefSafe Pro

References and the dependency graph

The References tab answers the two questions you ask before changing or deleting anything: what uses this? and what does this need?

Finding references

Select an asset — or right-click it in the Project window and choose RefSafe → Find References — and the tab shows:

  • Used by — every asset that references the selected asset
  • Depends on — every asset the selected asset requires

Results resolve to specific locations, not just file names. Inside scenes, references pin down to the component level, shown as HierarchyPath · ComponentName, so you know exactly which object in a large scene holds the link.

Search scope

Toggle between:

  • Project — the full asset dependency graph
  • Open Scenes — only currently loaded scenes, including live scene objects

Open Scenes catches something Project scope structurally cannot: references held by objects that exist only in an unsaved scene state.

The asset map cache

Reference search runs against a cached map of the project’s dependency graph. The first query builds it, which takes a moment on a large project; subsequent queries are fast.

The cache updates as assets change. After bulk operations outside Unity — a large source-control merge, say — you can force a rebuild via Rebuild Cache, or from script:

using RefSafe.Pro;

ReferenceSearchAPI.RebuildCache();

Dependency graph view

The graph view renders references as a navigable node graph with pan, zoom, and a minimap.

It earns its place in two situations. First, tracing a chain: asset A is heavy because it pulls in B, which pulls in C — the graph shows that path in one view, where a flat list doesn’t. Second, spotting a reference that shouldn’t exist, like a UI prefab dragging in a gameplay system.

Reference queries are available from editor scripts and CI through ReferenceSearchAPI:

using RefSafe.Pro;

ReferenceSearchResult usedBy = ReferenceSearchAPI.FindReferencesTo("Assets/Art/Logo.png");
ReferenceSearchResult deps   = ReferenceSearchAPI.FindDependenciesOf("Assets/Scenes/Main.unity");

if (ReferenceSearchAPI.IsCacheBuilt)
    Debug.Log($"Asset map holds {ReferenceSearchAPI.CachedAssetCount} assets.");

Both queries return a ReferenceSearchResult carrying the search target alongside its UsedBy and DependsOn entries.

A useful pattern is a pre-delete guard in a build or tooling script:

var result = ReferenceSearchAPI.FindReferencesTo(path);
if (result.UsedBy.Count > 0)
    Debug.LogError($"{path} still has {result.UsedBy.Count} referrer(s) — not safe to delete.");