Version: 2023.2
LanguageEnglish
  • C#

Hierarchy

class in Unity.Hierarchy

/

Implemented in:UnityEngine.HierarchyCoreModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Represents a tree-like container of nodes.

Properties

Count The total number of nodes.
IsCreated Whether or not this object is valid and uses memory.
Root The root node.
UpdateNeeded Whether the hierarchy requires an update.
Updating Whether the hierarchy is currently updating.

Constructors

Hierarchy Constructs a new Hierarchy.

Public Methods

Add Adds a new node that has Root as its parent to the hierarchy.
Clear Removes all nodes from the hierarchy.
Dispose Dispose this object to release its memory.
Exists Determines whether a node exists or not.
GetAllNodeTypeHandlersBase Gets all the node type handlers that this hierarchy uses.
GetChildren Gets the child nodes of a hierarchy node.
GetChildrenCount Gets the number of child nodes that a hierarchy node has.
GetDepth Determines the depth of a node.
GetName Gets the name of a hierarchy node.
GetNextSibling Gets the next sibling of a node.
GetNodeType Gets the type of the specified hierarchy node.
GetNodeTypeHandlerBase Gets a hierarchy node type handler instance from this hierarchy.
GetOrCreatePropertyString Creates a string property with a specified name.
GetOrCreatePropertyUnmanaged Creates an unmanaged property with a specified name.
GetParent Gets the parent of a hierarchy node.
GetSortIndex Gets the sorting index of a hierarchy node.
RegisterNodeTypeHandler Registers a hierarchy node type handler for this hierarchy.
Remove Removes a node from the hierarchy.
Reserve Reserves memory for nodes to use. Use this to avoid memory allocation hits when you add batches of nodes.
SetName Sets the name of a hierarchy node.
SetParent Sets the parent of a hierarchy node.
SetSortIndex Sets the sorting index of a hierarchy node.
SortChildren Sorts the child nodes of a hierarchy node according to their sort index.
UnregisterNodeTypeHandler Removes a hierarchy node type handler from this hierarchy.
Update Updates the hierarchy and requests that every registered hierarchy node type handler integrates their changes into the hierarchy.
UpdateIncremental Updates the hierarchy incrementally.
UpdateIncrementalTimed Incrementally updates the hierarchy until a time limit is reached.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961