Namespace: | Sirenix.OdinInspector.Editor |
Assembly: | Sirenix.OdinInspector.Editor |
public abstract class PropertyValueEntry : IPropertyValueEntry, IDisposable
protected PropertyValueEntry()
public Type BaseValueType { get; }
public PropertyContextContainer Context { get; }
public bool DictionaryChangedFromPrefab { get; }
public bool IsAlias { get; }
protected bool IsBoxedValueType { get; }
public bool IsEditable { get; }
public abstract bool IsMarkedAtomic { get; }
public bool ListLengthChangedFromPrefab { get; }
public abstract Type ParentType { get; }
The nearest parent property that has a value. That is, the property from which this value entry will fetch its parentvalues from in order to extract its own values.
If ParentValueProperty is null, this is a root property.
protected InspectorProperty ParentValueProperty { get; }
public InspectorProperty Property { get; }
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 SerializationBackend SerializationBackend { get; }
public string TargetReferencePath { get; }
public Type TypeOfValue { get; }
public bool ValueChangedFromPrefab { get; }
public int ValueCount { get; }
public PropertyValueState ValueState { get; }
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; }
public abstract IPropertyValueCollection WeakValues { get; }
public abstract bool ApplyChanges()
System.Boolean | True if any changes were made, otherwise, false. |
public static IPropertyValueEntry CreateAlias(PropertyValueEntry entry, Type valueType)
PropertyValueEntry | entry | |
System.Type | valueType |
Sirenix.OdinInspector.Editor.IPropertyValueEntry |
public void Dispose()
protected abstract Type GetMostPreciseContainedType()
System.Type |
protected abstract PropertyValueState GetValueState()
PropertyValueState |
protected abstract void Initialize()
public void RefreshPrefabModificationState()
public void Update()
protected abstract void UpdateValues()
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)
System.Object | value | The value to check differences against. |
System.Int32 | index | The selection index to compare against. |
System.Boolean |
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)
Sirenix.OdinInspector.Editor.IPropertyValueEntry | other |
System.Boolean |
public event Action<int> OnChildValueChanged
public event Action<int> OnValueChanged