Find exactly where assets are used with reverse-dependency lookups. Batch-replace project-wide references, fix missing dependencies, and consolidate scattered files using fast raw YAML injection.As a solo developer, I originally built the Asset Locator & Replacer to solve a recurring headache: managing the tangled dependency webs and massive file bloat that happens when prototyping environments or importing complex third-party asset packs.While standard Unity tools are excellent at showing you what a specific prefab relies on (e.g., clicking a model to see its assigned materials), they natively struggle to efficiently answer the reverse: What exactly in my massive project is relying on this specific placeholder texture? Deleting that texture blindly usually results in pink broken-material errors scattered across dozens of closed scenes.This free, pipeline-agnostic toolkit provides multithreaded utilities to execute project-wide reverse-dependency lookups, safely consolidate scattered assets into clean directories, and perform asynchronous, destructive batch replacements to swap out global references (GUIDs) without forcing you to manually open a single scene or prefab.Core Workflows & CapabilitiesThe toolkit is divided into three primary modules:1. The Asset Locator (Reverse-Dependency Tracking)This module is designed to safely track down how assets are being used across your entire project without loading heavy scenes into memory.Deep Project Scanning: Assign a Texture, Material, or Prefab to execute a targeted lookup. For example, assign a normal map, and the engine will locate all materials utilizing it, and subsequently every prefab and .unity scene utilizing those materials.Asset Consolidation: If you find a Prefab that relies on dependencies scattered across six different disorganized pack directories, clicking "Consolidate" will physically move the source asset, the found assets, and all underlying dependencies into a new target folder—automatically structuring them into clean subdirectories without breaking internal GUID links.Package Extraction: Bundle your initial source asset, all found dependent assets, and all of their internal requirements into a localized .unitypackage. This is ideal for cleanly extracting a working subset of assets from a massive project to share with a team member.2. The Batch Replacer (Project-Wide Rewiring)Instead of manually digging through hundreds of materials or scenes to swap out placeholder assets for final versions, this module rewires them globally in seconds.Automated Reference Replacement: The engine bypasses standard Unity APIs entirely. It utilizes asynchronous parallel background threads to read the raw text of your serialized files, finds the unique 32-character GUID of your old assets, dynamically injects the new GUIDs globally, and safely copies your originals into a backup folder.Sandbox Auto-Pairing: Drag your "Old" assets into the left column, and your "New" assets into the right. The tool's algorithm evaluates filenames and automatically pairs incoming targets, stripping common iteration tags (like _v2 or _new).Simulation Mode (Dry Run): Because this process is destructive, the tool defaults to a simulation mode. It runs the scan and populates a detailed checklist of affected files, allowing you to review and uncheck specific items before committing to writing any changes to your hard drive.3. Script Backup UtilityDuplicating a .cs script inside the Unity Project window instantly causes compiler lockouts due to duplicate class names. The integrated Script Backup utility allows you to drop C# scripts, compute shaders, or JSON files into a drop zone to instantly generate safe, timestamped .txt copies. This allows you to safely maintain version history directly within Unity before a massive code refactor.Realistic Expectations & Hard LimitsThis is a pragmatic utility designed to alter raw project data for maximum speed. It operates within strict mechanical boundaries to protect your files. Before executing any batches, please review these technical constraints:Strict Serialization Requirement: The Batch Replacer bypasses standard APIs to modify the raw text of your files. Because of this, your project must be set to "Force Text" serialization (Edit > Project Settings > Editor > Asset Serialization > Mode). If your project uses Binary or Mixed serialization, the execution UI will physically lock you out to prevent file corruption.Destructive Operations: The replacement mode is intentionally destructive. When executed, it permanently alters your files on disk. These operations cannot be cleanly undone using Unity's standard Ctrl+Z system. Do not execute these functions unless your project is actively backed up or managed via Version Control (Git, PlasticSCM, Perforce, etc.).Prefab Edit Mode Safety Block: If you attempt to execute a batch replacement while isolated inside Unity's Prefab Edit Mode, the tool will intentionally refuse to run. This prevents Unity's active memory cache from overwriting and reverting your new text replacements when you exit the prefab stage.Immutable Unity Packages: Assets residing within standard Unity Packages (the Packages/ directory) are treated as read-only by the engine. The tool cannot destructively modify these files and will safely skip them.Expand Your Pipeline & SupportThe Asset Locator & Replacer targets the first major bottleneck in environment design: tangled project architecture and unmanaged dependencies. Consolidating your architecture is step one. To get the maximum performance out of Unity, consider pairing this with the rest of the Veridian optimization pipeline:Step 1: Locator & Replacer (This Asset) – Cleans up architecture, unwinds tangled asset packs, and rewires dependencies.Step 2: Texture Converter – Universally resizes heavy textures, pads them to standard Power-of-Two dimensions, and mechanically packs fragmented PBR channels.Step 3: Materials Combinator – Takes your standardized textures, algorithmically atlases their maps together, and rewrites the underlying mesh UVs so dozens of unique props can share a single material draw-call.Step 4: Mesh Constructor – Takes your atlased prefabs and physically welds their geometry together into a unified static mesh, eliminating CPU transform-hierarchy overhead.Step 5: BurstLOD – Generates incredibly fast, high-quality runtime or Editor-based LODs for your welded geometry.As a solo developer, building and maintaining these utilities takes a significant amount of time. If this free toolkit rescues your project from dependency hell, speeds up your workflow, or saves you hours of manual prefab editing, please consider leaving a rating or review on the Asset Store. Reviews are the primary way tools gain visibility and directly support my ability to keep maintaining and updating them! I built the Asset Locator & Replacer to bypass Unity’s standard synchronous asset loading bottlenecks, aggressively managing system RAM and CPU threads to prevent the Editor from locking up or crashing during massive project-wide scans. Here is exactly how the engine operates:Requirements & CompatibilityMinimum Unity Version: Unity 2021 LTS or newer.Render Pipelines: Fully pipeline agnostic. Because the tool rewires dependencies at the raw text level directly on your hard drive, it is universally compatible with the Universal Render Pipeline (URP), High Definition Render Pipeline (HDRP), and the Built-in Render Pipeline.Native Dependencies: Built strictly using native .NET and C# libraries (System.Threading.Tasks, System.Text.RegularExpressions, System.Collections.Concurrent). There are no external third-party DLLs to clutter your project.Core Processing Architecture & Memory ManagementAsynchronous YAML Injection: Loading thousands of Prefabs and Scenes into active memory via standard AssetDatabase APIs just to check or replace a material reference causes massive RAM spikes. The AssetReplacementWorker bypasses Unity's APIs entirely. It utilizes asynchronous parallel background threads to read the raw text of your project's serialized YAML files. It uses highly specific Regex patterns to physically inject optimized 32-character GUID references directly at the text level, successfully rewiring thousands of dependencies in seconds.Parallel CPU Scanning: File reading and Regex evaluation are handed off to Parallel.ForEach loops utilizing a MaxDegreeOfParallelism based on your hardware's available CPU cores. Thread-safe ConcurrentBag collections are used to track file paths, modification requests, and execution errors without triggering race conditions.Large File Memory Safety (OOM Prevention): Uncompressed text streams consume system RAM rapidly. If the multithreaded worker attempts to read sixteen massive files (like 500MB baked Lightmap data assets or dense Terrain scenes) into your CPU cores simultaneously, Unity will instantly crash due to an Out-Of-Memory (OOM) error. To prevent this, the engine evaluates file byte sizes during the pre-scan. Any file exceeding a user-defined threshold (default 250MB) is intercepted, removed from the concurrent queue, and processed safely on a secondary synchronous thread with explicit GC.Collect() calls forced between reads to maintain a flat, predictable memory footprint.Regex Sub-Asset Handling: Replacing a standard texture is relatively simple, but replacing sub-assets (like specific nested meshes or sliced sprites) requires rewriting multiple lines simultaneously. The engine uses compiled, group-based Regex patterns to identify and evaluate both fileID and guid dependencies concurrently without destroying the surrounding structural YAML data.Project ArchitectureVCS Lock Protection: Before attempting a write operation to save a modified file, the engine explicitly evaluates the OS file attributes (FileAttributes.ReadOnly). If a file is locked by a Version Control System (like Perforce or PlasticSCM), the engine gracefully skips the file and logs a warning, preventing hardware write-exceptions from failing the entire batch.Non-Indexing Backup Structure: When "Auto-Backup" is enabled, original files are copied to a specialized Assets/VeridianData/.../Backups~ directory. The tilde (~) suffix is an intentional architectural trick—it acts as a low-level command instructing Unity's AssetDatabase to completely ignore the folder. This prevents the engine from wasting time generating .meta files for your backups and prevents catastrophic duplicate GUID clashes.Tail Latency Optimization: When conducting project-wide dependency scans, the worker intelligently sorts the targeted files by byte size (OrderByDescending(fi => fi.Length)). This solves the multithreading "tail-latency" problem by assigning the most massive files to processor cores immediately. Smaller files then fill in the thread gaps at the end of the batch, which drastically speeds up total disk I/O execution time.API Reference & Headless ExecutionDecoupled Architecture: The Editor window is strictly a UI wrapper. All underlying processing logic is housed within the Veridian.AssetReplacer namespace, allowing technical artists and pipeline engineers to trigger the tools directly via their own C# scripts.Task-Based Asynchronous API: Developers can invoke the asynchronous engine via script to build automated pipelines. You can structure an AssetReplacementData object and pass it directly into await AssetReplacementWorker.ReplaceReferencesAsync() to run optimizations entirely in the background.Headless Project Auditing: Build engineers can utilize the native FindMultipleReferencesAsync() method from a pre-build script to automatically scan the project and guarantee that no procedural greybox materials or placeholder textures are accidentally included before a final server build is compiled.Hard LimitsAs a pragmatic tool designed to keep your project safe, it operates with a few non-negotiable boundaries:Serialization Mode: The automated reference replacer strictly requires the project's Asset Serialization Mode to be set to "Force Text". If your project uses Binary or Mixed serialization, the tool will physically lock execution to prevent irreversible file corruption.Prefab Stage Cache Blocks: If the engine modifies physical .prefab text files on your hard drive in the background while a Prefab is actively open in Edit Mode, exiting the Prefab will cause Unity to write its outdated memory cache to the disk—permanently reverting your new replacements. The tool actively detects the Prefab Stage and locks execution to protect your changes.Immutable Unity Packages: Assets residing within standard Unity Packages (the Packages/ directory) are treated as read-only by the engine and will be safely skipped during text modifications.

