PrefabModificationHandler

Handles all prefab modifications that apply to the targets of a property tree, if any. This class determines which properties have modifications, what the modifications are, auto-applies modifications if the current instance values do not correspond to the prefab values, and also provides an API for modifying those modifications.

NOTE: This class is liable to see a lot of changes, as the prefab modification system is slated to be redesigned for increased extendability in the future. Do not depend overly on the current API.

namespace Sirenix.OdinInspector.Editor
{
public sealed class PrefabModificationHandler
}

Requirements

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector
Version: 2.0.0.0

Properties

Return Type Definition Description
bool HasPrefabs Whether any of the values the property tree represents are prefab instances.
PropertyTree PrefabPropertyTree A prefab tree for the prefabs of this property tree's prefab instances, if any exist.
ImmutableList<Object> TargetPrefabs The prefabs for each prefab instance represented by the property tree, if any.

Methods

Return Type Definition Description
List<PrefabModification> GetPrefabModifications(int) Gets all prefab modifications in this property tree for a given selection index.
Nullable<PrefabModificationType> GetPrefabModificationType(InspectorProperty, bool) Gets the prefab modification type of a given property, if any.
void RegisterPrefabDictionaryAddKeyModification(InspectorProperty, int, Object) Adds an add key modification to the dictionary modifications of a given property.
void RegisterPrefabDictionaryDeltaModification(InspectorProperty, int) Calculates a delta between the current dictionary property and its prefab counterpart, and registers that delta as a Dictionary modification.
void RegisterPrefabDictionaryRemoveKeyModification(InspectorProperty, int, Object) Adds a remove key modification to the dictionary modifications of a given property.
void RegisterPrefabListLengthModification(InspectorProperty, int, int) Registers a modification of type ListLength for a given property.
void RegisterPrefabValueModification(InspectorProperty, int, bool) Registers a modification of type Value for a given property.
void RemovePrefabDictionaryModification(InspectorProperty, int, Object) Removes all dictionary modifications on a property for a given dictionary key value.
void RemovePrefabModification(InspectorProperty, int, PrefabModificationType) Removes all prefab modifications of a given type on a given property.