Namespace: | Sirenix.OdinInspector.Editor |
Assembly: | Sirenix.OdinInspector.Editor |
public sealed class PropertyTree<T> : PropertyTree, IDisposable
Represents a set of strongly typed values as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties.
This class also handles management of prefab modifications.
public PropertyTree()
public PropertyTree(T[] targets)
T[] | targets | The targets to represent. |
public PropertyTree(T[] targets, SerializedObject serializedObject)
T[] | targets | The targets to represent. |
UnityEditor.SerializedObject | serializedObject | The serialized object to represent. Note that the target values of the given UnityEditor.SerializedObject must be the same values given in the targets parameter. |
System.ArgumentNullException | targets is null |
System.ArgumentException | There must be at least one target. or A given target is a null value. |
public PropertyTree(T[] targets, SerializedObject serializedObject, SerializationBackend backend = null)
T[] | targets | The targets to represent. |
UnityEditor.SerializedObject | serializedObject | The serialized object to represent. Note that the target values of the given UnityEditor.SerializedObject must be the same values given in the targets parameter. |
SerializationBackend | backend | The serialization backend to use for the tree root. |
System.ArgumentNullException | targets is null |
System.ArgumentException | There must be at least one target. or A given target is a null value. |
public PropertyTree(SerializedObject serializedObject)
UnityEditor.SerializedObject | serializedObject | The serialized object to represent. |
protected override bool HasRootPropertyYet { get; }
public override PrefabModificationHandler PrefabModificationHandler { get; }
public override InspectorProperty RootProperty { get; }
public override int RootPropertyCount { get; }
public ImmutableList<T> Targets { get; }
public override Type TargetType { get; }
public override SerializedObject UnitySerializedObject { get; }
public override int UpdateID { get; }
public override ImmutableList<object> WeakTargets { get; }
public override bool ApplyChanges()
System.Boolean | true if any values were changed, otherwise false |
public override void CleanForCachedReuse()
public override void DelayAction(Action action)
System.Action | action | The action delegate to be delayed. |
System.ArgumentNullException | action |
public override void DelayActionUntilRepaint(Action action)
System.Action | action | The action to be delayed. |
System.ArgumentNullException | action |
protected override void DisposeAndResetRootProperty()
protected override void DisposeInheritedStuff()
public override IEnumerable<InspectorProperty> EnumerateTree(bool includeChildren = true, bool onlyVisible = false)
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.Boolean | onlyVisible | Whether to only include visible properties. Properties whose parents are invisible are considered invisible. |
System.Collections.Generic.IEnumerable<InspectorProperty> |
public override InspectorProperty GetPropertyAtPath(string path)
System.String | path | The path of the property to get. |
InspectorProperty |
public override InspectorProperty GetPropertyAtPath(string path, out InspectorProperty closestProperty)
System.String | path | The path of the property to get. |
InspectorProperty | closestProperty |
InspectorProperty |
public override InspectorProperty GetPropertyAtPrefabModificationPath(string path)
System.String | path | The prefab modification path for the property. |
InspectorProperty | The property found at the path. |
public override InspectorProperty GetPropertyAtPrefabModificationPath(string path, out InspectorProperty closestProperty)
System.String | path | The prefab modification path for the property. |
InspectorProperty | closestProperty |
InspectorProperty | The property found at the path. |
public override InspectorProperty GetPropertyAtUnityPath(string path)
System.String | path | The unity path for the property. |
InspectorProperty | The property found at the path. |
public override InspectorProperty GetPropertyAtUnityPath(string path, out InspectorProperty closestProperty)
System.String | path | The unity path for the property. |
InspectorProperty | closestProperty |
InspectorProperty | The property found at the path. |
public override int GetReferenceCount(object reference)
System.Object | reference |
System.Int32 |
public override InspectorProperty GetRootProperty(int index)
System.Int32 | index | The index of the property to get. |
InspectorProperty |
public override 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 override void InvokeDelayedActions()
public override 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 override void RegisterPropertyDirty(InspectorProperty property)
InspectorProperty | property |
System.NotImplementedException |
public override 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. |
System.ArgumentNullException | |
System.ArgumentException | The value to replace with must either be null or be the same type as the value to replace (" + from.GetType().Name + "). |
public override void SetSerializedObject(SerializedObject serializedObject)
UnityEditor.SerializedObject | serializedObject |
public override void SetTargets(params object[] newTargets)
System.Object[] | newTargets |
public override void UpdateTree()