Version 3.3.1.2

PropertyValueEntryAlias<TActualValue, TValue> class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public sealed class PropertyValueEntryAlias<TActualValue, TValue> : PropertyValueEntryAlias, IPropertyValueEntry<TValue>, IPropertyValueEntry, IDisposable, IValueEntryActualValueSetter<TValue>, IValueEntryActualValueSetter
A polymorphic alias for a PropertyValueEntry instance, used to implement strongly typed polymorphism in Odin.
Inheritance

Type Parameters

TActualValue

TValue

Constructors

PropertyValueEntryAlias(PropertyValueEntry)
Initializes a new instance of the PropertyValueEntryAlias<TActualValue, TValue> class.
public PropertyValueEntryAlias(PropertyValueEntry valueEntryWeak)
Parameters
PropertyValueEntry valueEntryWeak

Exceptions
System.ArgumentNullException

valueEntry is null

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.
public override Type BaseValueType { get; }
DictionaryChangedFromPrefab
Whether this value entry has had its dictionary values changes from its prefab counterpart.
public override bool DictionaryChangedFromPrefab { get; }
IsEditable
Whether this value entry is editable or not.
public override bool IsEditable { get; }
IsMarkedAtomic
Whether this type is marked as an atomic type using a Sirenix.OdinInspector.Editor.IAtomHandler.
public override bool IsMarkedAtomic { get; }
ListLengthChangedFromPrefab
Whether this value entry has had its list length changed from its prefab counterpart.
public override 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.
public override Type ParentType { get; }
Property
The property whose values this value entry represents.
public override 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.

public override SerializationBackend SerializationBackend { get; }
SmartValue

A strongly 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.

public TValue SmartValue { get; set; }
TargetReferencePath
If this value entry has the override type Reference, this is the path of the property it references.
public override 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.
public override Type TypeOfValue { get; }
ValueChangedFromPrefab
Whether this value entry has been changed from its prefab counterpart.
public override bool ValueChangedFromPrefab { get; }
ValueCount
The number of parallel values this entry represents. This will always be exactly equal to the count of WeakTargets.
public override int ValueCount { get; }
Values
Provides access to the strongly typed values of this value entry.
public IPropertyValueCollection<TValue> Values { get; }
ValueState
The special state of the value entry.
public override 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.

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

Methods

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

True if any changes were made, otherwise, false.

Dispose()
public override void Dispose()
SetActualValue(Int32, Object)
Sets the actual value of a value entry, for a given selection index.
protected override sealed void SetActualValue(int index, object value)
Parameters
System.Int32 index

System.Object value

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.
public override void Update()
ValueIsPrefabDifferent(TValue, 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.

public bool ValueIsPrefabDifferent(TValue value, int index)
Parameters
TValue value

The value to check differences against.

System.Int32 index

The selection index to compare against.

Returns
System.Boolean

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.

public override 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.

public override bool ValueTypeValuesAreEqual(IPropertyValueEntry other)
Parameters
Sirenix.OdinInspector.Editor.IPropertyValueEntry other

Returns
System.Boolean

Events

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