Namespace: | Sirenix.OdinInspector.Editor |
Assembly: | Sirenix.OdinInspector.Editor |
public abstract class PropertyTree : IDisposable
Represents a set of values of the same type as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties.
public PropertyTree()
public OdinAttributeProcessorLocator AttributeProcessorLocator { get; set; }
public DrawerChainResolver DrawerChainResolver { get; set; }
public bool DrawMonoScriptObjectField { get; set; }
public bool IsStatic { get; protected set; }
public abstract PrefabModificationHandler PrefabModificationHandler { get; }
public OdinPropertyResolverLocator PropertyResolverLocator { get; set; }
public abstract int RootPropertyCount { get; }
public abstract InspectorProperty SecretRootProperty { get; }
public abstract Type TargetType { get; }
public abstract SerializedObject UnitySerializedObject { get; }
public abstract int UpdateID { get; }
public abstract ImmutableList<object> WeakTargets { get; }
public abstract bool ApplyChanges()
System.Boolean | true if any values were changed, otherwise false |
Creates a new PropertyTree for a set of given target values.
Note that the targets all need to be of the same type.
public static PropertyTree Create(IList targets)
System.Collections.IList | targets | The targets to create a tree for. |
PropertyTree |
Creates a new PropertyTree for a set of given target values, represented by a given UnityEditor.SerializedObject.
Note that the targets all need to be of the same type.
public static PropertyTree Create(IList targets, SerializedObject serializedObject)
System.Collections.IList | targets | The targets to create a tree for. |
UnityEditor.SerializedObject | serializedObject | The serialized object to create a tree for. Note that the target values of the given UnityEditor.SerializedObject must be the same values given in the targets parameter. |
PropertyTree |
public static PropertyTree Create(object target)
System.Object | target | The target to create a tree for. |
PropertyTree |
System.ArgumentNullException | target is null |
Creates a new PropertyTree for a set of given target values.
Note that the targets all need to be of the same type.
public static PropertyTree Create(params object[] targets)
System.Object[] | targets | The targets to create a tree for. |
PropertyTree |
System.ArgumentNullException | targets is null |
public static PropertyTree Create(SerializedObject serializedObject)
UnityEditor.SerializedObject | serializedObject | The serialized object to create a tree for. |
PropertyTree |
System.ArgumentNullException | serializedObject is null |
public static PropertyTree CreateStatic(Type type)
System.Type | type | The type to inspect. |
PropertyTree | A PropertyTree instance for inspecting the type. |
public abstract void DelayAction(Action action)
System.Action | action | The action delegate to be delayed. |
public abstract void DelayActionUntilRepaint(Action action)
System.Action | action | The action to be delayed. |
public void Dispose()
protected virtual void Dispose(bool finalizer)
System.Boolean | finalizer |
Draw the property tree, and handles management of undo, as well as marking scenes and drawn assets dirty.
This is a shorthand for calling BeginDrawPropertyTree(PropertyTree, Boolean), DrawPropertiesInTree(PropertyTree) and . EndDrawPropertyTree(PropertyTree).
public void Draw(bool applyUndo = true)
System.Boolean | applyUndo |
public abstract IEnumerable<InspectorProperty> EnumerateTree(bool includeChildren)
System.Boolean | includeChildren | Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. |
System.Collections.Generic.IEnumerable<InspectorProperty> |
protected void Finalize()
public abstract InspectorProperty GetPropertyAtPath(string path)
System.String | path | The path of the property to get. |
InspectorProperty |
public abstract InspectorProperty GetPropertyAtPath(string path, out InspectorProperty closestProperty)
System.String | path | The path of the property to get. |
InspectorProperty | closestProperty |
InspectorProperty |
public abstract InspectorProperty GetPropertyAtPrefabModificationPath(string path)
System.String | path | The prefab modification path of the property to get. |
InspectorProperty |
public abstract InspectorProperty GetPropertyAtPrefabModificationPath(string path, out InspectorProperty closestProperty)
System.String | path | The prefab modification path of the property to get. |
InspectorProperty | closestProperty |
InspectorProperty |
public abstract InspectorProperty GetPropertyAtUnityPath(string path)
System.String | path | The Unity path of the property to get. |
InspectorProperty |
public abstract InspectorProperty GetPropertyAtUnityPath(string path, out InspectorProperty closestProperty)
System.String | path | The Unity path of the property to get. |
InspectorProperty | closestProperty |
InspectorProperty |
public abstract int GetReferenceCount(object reference)
System.Object | reference |
System.Int32 |
public abstract InspectorProperty GetRootProperty(int index)
System.Int32 | index | The index of the property to get. |
InspectorProperty |
public SerializedProperty GetUnityPropertyForPath(string path)
System.String | path | The Odin or Unity path to the property to get. |
UnityEditor.SerializedProperty |
public abstract SerializedProperty GetUnityPropertyForPath(string path, out FieldInfo backingField)
System.String | path | The Odin or Unity path to the property to get. |
System.Reflection.FieldInfo | backingField | The backing field of the Unity property. |
UnityEditor.SerializedProperty |
public abstract void InvokeDelayedActions()
public void InvokeOnValidate()
public abstract bool ObjectIsReferenced(object value, out string referencePath)
System.Object | value | The reference value to check. |
System.String | referencePath | The first found path of the object. |
System.Boolean |
public abstract void RegisterPropertyDirty(InspectorProperty property)
InspectorProperty | property |
public abstract void ReplaceAllReferences(object from, object to)
System.Object | from | The value to find all instances of. |
System.Object | to | The value to replace the found values with. |
public abstract void UpdateTree()
public event PropertyTree.OnPropertyValueChangedDelegate OnPropertyValueChanged
public event Action OnUndoRedoPerformed