RefSafe Pro
API reference
The public scripting surface of RefSafe Pro 2.2.0 — the types you use to read scan results and to plug your own rules, fixers, and exporters into the pipeline.
All public types live in the RefSafe.Pro namespace, split across two assemblies:
RefSafe.Pro.Core (data models and enums, no editor dependency) and
RefSafe.Pro.Editor (scanning, extension points, integrations). For a guided
introduction with working examples, read
extending RefSafe Pro.
Results
ScanIssue class Single issue found during a Pro scan.
ReferenceLocation class Immutable location data for where an issue was found. Extended to support asset paths for prefabs, ScriptableObjects, and other project assets.
ScanResult class Aggregated scan results with filtering, grouping, and statistics. Severity and type counters are maintained incrementally on AddIssue / AddIssues / Clear so callers can read them in O(1) from per-frame UI without walking the issue list.
ScanDiffResult class Result of comparing current scan against a cached scan.
ScanHistoryEntry class One recorded scan summary entry for trend tracking.
Enums
IssueType enum Categories of issues the Pro detection engine can identify.
IssueSeverity enum Three-tier severity classification for scan issues.
ScanScope enum Defines the scope of a Pro scan operation.
ScanPhase enum Lifecycle state of a Pro scan. Transitions are linear: Idle → Running → (Completed | Cancelled | Faulted). Once a terminal phase (Completed, Cancelled, Faulted) is set, it is sticky — EndScan will not silently overwrite it.
ScanState class Tracks Pro scan state with progress reporting, cancel support, and statistics.
WindowMode enum Modes for the main RefSafe Pro window.
Models
RuleConfig class Per-rule configuration: enabled state and optional severity override.
IgnoreEntry class A single ignored or snoozed issue, persisted in settings.
CleanerEntry class Represents an unused asset or empty folder found by the Project Cleaner.
ReferenceEntry class A single dependency edge surfaced by the reference search. Project-scope entries are asset-to-asset; scene-scope entries also carry the in-scene HierarchyPath and ComponentName of the GameObject that holds the reference.
ReferenceScope enum Search scope used by ReferenceSearchAPI and the References panel.
ReferenceSearchResult class Result of a reference search for a single asset.
RefSafeVersion class Holds the current version of the RefSafe Pro plugin.
Custom rules
IValidationRule interface Validation rule contract for Pro detection engine.
IAssetValidationRule interface Validation rule contract for non-GameObject assets (ScriptableObjects, Materials, etc.).
ValidationRuleAttribute class Marks an IValidationRule or IAssetValidationRule implementation for automatic discovery by the ValidationRuleRegistry.
ValidationRuleRegistry class Discovers, caches, and provides validation rule instances. Respects per-rule settings from Settings.
ValidationRuleRegistry.RuleEntry struct Metadata and instance for a discovered validation rule.
Custom fixers
IIssueFixer interface Contract for auto-fix implementations that can resolve scan issues.
IssueFixerAttribute class Marks an IIssueFixer so that FixerRegistry auto-discovers it. External fixers decorated with this attribute are picked up on assembly load.
IFixSuggestionProvider interface Produces candidate replacements for an issue alongside the deterministic fix the matching IIssueFixer offers. Currently consumed by the missing-reference flow to surface "Replace with…" entries beneath the existing "Clear" action.
FixSuggestion class One candidate replacement, presented in the Fix-button dropdown.
FixerRegistry class Discovers and caches IIssueFixer implementations. Built-in fixers plus any external type decorated with IssueFixerAttribute are auto-registered on first access. External code may also register additional fixers explicitly via Register(IIssueFixer, int).
Custom exporters
IReportExporter interface Pluggable scan-report exporter. Decorate the implementing type with ReportExporterAttribute so that ExporterRegistry auto-discovers it; RefSafe Pro's UI and CLI will then offer the exporter alongside the built-in CSV/JSON/HTML/TXT/Markdown formats.
ReportExporterAttribute class Marks an IReportExporter so that ExporterRegistry can auto-discover it and surface it in the RefSafe Pro UI and CLI.
ExporterRegistry class Discovers IReportExporter implementations decorated with ReportExporterAttribute and exposes them to the UI and CLI. External assemblies get picked up automatically on next cold access; call Refresh to re-scan after assembly reload.
ExporterRegistry.ExporterEntry struct Metadata + instance for a discovered exporter.
Scripting
ReferenceSearchAPI class Public static API for programmatic reference searches. Useful for custom editor scripts and CI/CD integration.
RefSafeApp class Application-scope composition root for RefSafe Pro. Built once per editor session (re-built automatically on every domain reload via InitializeOnLoadAttribute) and holds every service whose lifetime is "as long as the editor is running": logging, clock, event bus, ignore list store, scan history, scan cache, incremental tracker, the scope-dispatching ScanController, and the IScanIssuesUseCase transaction boundary that wraps it.
CliRunner class Command-line entry point for CI/CD integration. Run via: Unity -batchmode -executeMethod RefSafe.Pro.CliRunner.RunScan [options]
Options: --scope [OpenScenes|AllScenes|AllPrefabs|AllScriptableObjects|EntireProject] --format [json|csv|txt|html] --output [filePath] --fail-threshold [Critical|Warning|Info]
Exit codes: 0 = No issues above threshold 1 = Issues found above threshold 2 = Scan error
This reference is generated from the RefSafe Pro 2.2.0 source, so it always matches the shipping package.