Version 2.1.0.0

IPropertyValueEntry interface

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public interface IPropertyValueEntry : IDisposable
Represents the values of an InspectorProperty, and contains utilities for querying the values' type and getting and setting them.

Properties

BaseValueType
The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection.
Type BaseValueType { get; }
Context
The context container of this property.
PropertyContextContainer Context { get; }
DictionaryChangedFromPrefab
Whether this value entry has had its dictionary values changes from its prefab counterpart.
bool DictionaryChangedFromPrefab { get; }
IsAlias
Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism.
bool IsAlias { get; }
IsEditable
Whether this value entry is editable or not.
bool IsEditable { get; }
IsMarkedAtomic
Whether this type is marked as an atomic type using a IAtomHandler.
bool IsMarkedAtomic { get; }
ListLengthChangedFromPrefab
Whether this value entry has had its list length changed from its prefab counterpart.
bool ListLengthChangedFromPrefab { get; }
ParentType
The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection.
Type ParentType { get; }
Property
The property whose values this value entry represents.
InspectorProperty Property { get; }
SerializationBackend

The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of.

Note that this is *not* always equal to SerializationBackend.

SerializationBackend SerializationBackend { get; }
TargetReferencePath
If this value entry has the override type Reference, this is the path of the property it references.
string TargetReferencePath { get; }
TypeOfValue
The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from BaseValueType.
Type TypeOfValue { get; }
ValueChangedFromPrefab
Whether this value entry has been changed from its prefab counterpart.
bool ValueChangedFromPrefab { get; }
ValueCount
The number of parallel values this entry represents. This will always be exactly equal to the count of WeakTargets.
int ValueCount { get; }
ValueState
The special state of the value entry.
PropertyValueState ValueState { get; }
WeakSmartValue

A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel.

This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values.

object WeakSmartValue { get; set; }
WeakValues
Provides access to the weakly typed values of this value entry.
IPropertyValueCollection WeakValues { get; }

Methods

ApplyChanges()
Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary.
bool ApplyChanges()
Returns
System.Boolean

True if any changes were made, otherwise, false.

Update()
Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly.
void Update()
ValueIsPrefabDifferent(Object, Int32)

Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks.

If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from GetEqualityComparerDelegate<T>() is used.

This method is best ignored unless you know what you are doing.

bool ValueIsPrefabDifferent(object value, int index)
Parameters
System.Object value

The value to check differences against.

System.Int32 index

The selection index to compare against.

Returns
System.Boolean

ValueTypeValuesAreEqual(IPropertyValueEntry)

Checks whether the values in this value entry are equal to the values in another value entry.

Note, both value entries must have the same value type, and must represent values that are .NET value types.

bool ValueTypeValuesAreEqual(IPropertyValueEntry other)
Parameters
IPropertyValueEntry other

Returns
System.Boolean

Events

OnChildValueChanged
An event that is invoked during ApplyChanges(), when any child values have changed.
event Action<int> OnChildValueChanged
OnValueChanged
An event that is invoked during ApplyChanges(), when any values have changed.
event Action<int> OnValueChanged