Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Hierarchy

Represents a tree-like container of nodes.
Read time 3 minutesLast updated 9 days ago

Definition

public sealed class Hierarchy : IDisposable

Constructors

Constructor

Description

Hierarchy()Constructs a new Hierarchy.

Properties

Property

Description

CountThe total number of nodes.
IsCreatedWhether or not this object is valid and uses memory.
RootThe root node.
UpdateNeededWhether the hierarchy requires an update.
UpdatingWhether the hierarchy is currently updating.

Methods

Method

Description

AddAdds a new node that has a specified parent node to the hierarchy.
ClearRemoves all nodes from the hierarchy.
DisposeDispose this object to release its memory.
DoesChildrenNeedsSortingGets whether the child nodes of a hierarchy node need to be sorted.
EnumerateChildrenGets the child nodes of a hierarchy node.
EnumerateNodeTypeHandlersBaseEnumerates all the node type handlers base that this hierarchy uses.
ExistsDetermines whether a node exists or not.
GetChildGets the child node at the specified index of a hierarchy node.
GetChildIndexGets the index of a hierarchy node in its parent's children list.
GetChildrenGets the child nodes of a hierarchy node.
GetChildrenCountGets the number of child nodes that a hierarchy node has.
GetChildrenCountRecursiveGets the number of child nodes that a hierarchy node has, including children of children.
GetDepthDetermines the depth of a node.
GetHashCodeGets the hash code for the specified hierarchy node.
GetNameGets the name of a hierarchy node.
GetNextSiblingGets the next sibling of a node.
GetNodeTypeRetrieve the hierarchy node type for the specified node.
GetNodeTypeHandlerBaseGets the node type handler instance for the specified node type name from this hierarchy.
GetOrCreateNodeTypeHandlerGet or create a hierarchy node type handler instance for this hierarchy.
GetOrCreatePropertyStringCreates a string property with a specified name.
GetOrCreatePropertyUnmanagedCreates an unmanaged property with a specified name.
GetParentGets the parent of a hierarchy node.
GetPathGets the path of a hierarchy node.
GetSortIndexGets the sort index of a hierarchy node. Default is 0.
RemoveRemoves a node from the hierarchy.
RemoveChildrenRecursively removes all children of a node.
ReserveEnsures that the hierarchy has enough memory reserved for storing the specified number of nodes.
ReserveChildrenEnsures that the hierarchy node has enough memory reserved for storing the specified number of children nodes.
SetChildrenNeedsSortingMarks a hierarchy node as requiring sorting of its children in the next sorting operation.
SetDirtyForce an update of the hierarchy, even if no changes are pending.
SetNameSets the name of a hierarchy node.
SetParentSets the parent of a hierarchy node.
SetSortIndexSets the sort index of a hierarchy node.
SortChildrenSorts the child nodes of a hierarchy node according to their sort index.
SortChildrenRecursiveSorts the child nodes of a hierarchy node according to their sort index.
UpdateUpdates the hierarchy, executing all pending changes in the command list.
UpdateIncrementalUpdates the hierarchy incrementally, executing one pending change in the command list.
UpdateIncrementalTimedUpdates the hierarchy incrementally, executing pending changes in the command list until a time limit is reached.