Documentation
¶
Overview ¶
Package xref scans a Unity project for inbound PPtr references to a set of fileIDs inside a target asset. It is per-mutation (no caching — a cached index could go stale and mask a dangling reference) and conservative: a file whose references cannot be fully accounted for is reported as "indeterminate" so a consumer can treat uncertainty as a block reason.
The API takes a fileID SET (a single reparent target is the size-1 case) so the same scanner backs the delete/--cascade subtree case later (S5). reparent uses only the inbound list + indeterminate list as visibility; delete will use them as block reasons.
It uses unity-ctx's own parser (which parses both inline `{fileID, guid}` and block-style multi-line PPtrs) rather than the kernel's single-line ExtractRefs, which silently drops block-style references. As a completeness backstop, any file whose raw bytes mention the target GUID more times than structured PPtr references were recovered is flagged indeterminate — so an unparseable reference form can never be silently reported as "no refs".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InboundHit ¶
InboundHit is one other file that references the target asset's fileIDs.
type Result ¶
type Result struct {
TargetGUID string
// Inbound: files (other than the target) holding a PPtr {fileID in set, guid:
// target} — a cross-file reference into the edited object set.
Inbound []InboundHit
// Indeterminate: files whose references could not be fully accounted for
// (parse failure, or a target-GUID mention not recovered as a structured
// PPtr). Conservative signal: their inbound refs are unknown.
Indeterminate []string
}
func ScanInbound ¶
ScanInbound walks the project's Assets/ and enumerates inbound PPtr references to (target GUID, fileID set), excluding the target file itself (in-file links are the graph-check's job). It never writes.