Version 3.3.0.1

PropertyValueEntryAlias class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public abstract class PropertyValueEntryAlias : IPropertyValueEntry, IDisposable, IValueEntryActualValueSetter
A polymorphic alias for a PropertyValueEntry instance, used to implement strongly typed polymorphism in Odin.
Inheritance
  • System.Object
  • PropertyValueEntryAlias

Constructors

PropertyValueEntryAlias()
protected PropertyValueEntryAlias()

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 abstract Type BaseValueType { get; }
Context
The context container of this property.
public PropertyContextContainer Context { get; }
DictionaryChangedFromPrefab
Whether this value entry has had its dictionary values changes from its prefab counterpart.
public abstract 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.
public bool IsAlias { get; }
IsEditable
Whether this value entry is editable or not.
public abstract bool IsEditable { get; }
IsMarkedAtomic
Whether this type is marked as an atomic type using a Sirenix.OdinInspector.Editor.IAtomHandler.
public abstract bool IsMarkedAtomic { get; }
ListLengthChangedFromPrefab
Whether this value entry has had its list length changed from its prefab counterpart.
public abstract 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 abstract Type ParentType { get; }
Property
The property whose values this value entry represents.
public abstract 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 abstract SerializationBackend SerializationBackend { get; }
TargetReferencePath
If this value entry has the override type Reference, this is the path of the property it references.
public abstract 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 abstract Type TypeOfValue { get; }
ValueChangedFromPrefab
Whether this value entry has been changed from its prefab counterpart.
public abstract bool ValueChangedFromPrefab { get; }
ValueCount
The number of parallel values this entry represents. This will always be exactly equal to the count of WeakTargets.
public abstract int ValueCount { get; }
ValueState
The special state of the value entry.
public abstract 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 abstract object WeakSmartValue { get; set; }
WeakValues
Provides access to the weakly typed values of this value entry.
public abstract IPropertyValueCollection WeakValues { get; }

Methods

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

True if any changes were made, otherwise, false.

Dispose()
public abstract void Dispose()
SetActualValue(Int32, Object)
Sets the actual value of a value entry, for a given selection index.
protected abstract 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 abstract 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.

public abstract 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 abstract 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 abstract event Action<int> OnChildValueChanged
OnValueChanged
An event that is invoked during ApplyChanges(), when any values have changed.
public abstract event Action<int> OnValueChanged