diffAgainstSource
diffAgainstSource(
source,instance,options?):object
Defined in: prefab/diff.ts:67
Compute the minimal PrefabOverride[] that, applied to source, produces
the instance state. The editor calls this on every change to an instance
to keep prefab:overrides accurate.
Contract:
applyOverrides(flattenPrefab(source, [], ctx), diffAgainstSource(source, instance))
reproduces instance modulo runtime id remapping.
Current scope:
- Handles property / component_added / component_replaced / component_removed / name / visibility / metadata_set / metadata_removed
- Handles instance entities that are NEW relative to source (reports them
via
untracked— caller decides whether to surface as variant additions or error) - Does NOT yet emit “entity_removed” overrides (entity deletion from an
instance has no override type today); missing entities are reported via
orphanedSourceIds.
Parameters
Section titled “Parameters”source
Section titled “source”instance
Section titled “instance”readonly ProcessedEntity[]
options?
Section titled “options?”Returns
Section titled “Returns”object
orphanedSourceIds
Section titled “orphanedSourceIds”orphanedSourceIds:
string[]
overrides
Section titled “overrides”overrides:
PrefabOverride[]
untracked
Section titled “untracked”untracked:
ProcessedEntity[]