public interface IPrefabSourceWhere an inspected object came from, for override indication and revert.
Remarks
An interface rather than something this assembly implements, because what a prefab is belongs to the scene document — this assembly only needs four questions answered about it, and asking them through a contract is what keeps the inspector usable in a test with no project on disk.
⚠⚠ "Overridden" is a claim the instance records, not a value comparison, and the two halves below are what make that expressible from a panel. Doc 47 § 3 rejected the comparison outright: an author who turns a lamp's intensity down to 0 — or up to exactly the value the template already had — has said something a comparison cannot see, so the row would stop being marked and the revert button would grey out on the one edit the author most wants to take back. An implementation that answers IsOverridden by comparing values is that defect, reintroduced at the layer nobody tests.
Claim and Release both default to doing nothing, so a source that only displays — a stub in a test, a read-only view of somebody else's document — implements two methods as it always did. The default is "no", for TryMergeWith's reason: recording an authoring decision is a claim about a file, and a source that has not thought about it should not be making one.
Methods (4)
bool IsOverridden(object target, InspectorMember member)Whether an object's member is the instance's own rather than the prefab's.
bool TryGetPrefabValue(object target, InspectorMember member, out object? value)The value the prefab has for a member, in the space the object reads it in.
bool Claim(object target, InspectorMember member)Records that a member has just been given a value of the instance's own.
bool Release(object target, InspectorMember member)Gives a member back to the template, which is the half of a revert a value cannot say.
Used by (7)
- InspectorFieldVixen.Editor.Inspector
- InspectorTargetVixen.Editor.Inspector
- InspectorViewVixen.Editor.Inspector
- MarkupBindingTestsVixen.Editor.Inspector.Tests
- PrefabSourceVixen.Editor.AssetEditors
- StubPrefabVixen.Editor.Inspector.Tests
- StubPrefabVixen.Editor.Inspector.Tests