# HierarchyCommandList

> Represents a list of commands that modify a hierarchy.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Hierarchy](/engine/6000.7/script-reference/unity/hierarchy.md)
* **Assembly:** UnityEngine.HierarchyCoreModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public sealed class HierarchyCommandList : IDisposable
```

## Constructors

| Constructor                                                                                                                                  | Description                                                                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [HierarchyCommandList(Unity.Hierarchy.Hierarchy,System.Int32)](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/ctor.md) | Constructs a new [HierarchyCommandList](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist.md). |

## Properties

| Property                                                                                           | Description                                                     |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [Capacity](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/capacity.md)       | The capacity in bytes for storing commands in the command list. |
| [IsCreated](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/iscreated.md)     | Determines if this object is valid and uses memory.             |
| [IsEmpty](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/isempty.md)         | Determines if the command list is empty.                        |
| [IsExecuting](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/isexecuting.md) | Determines if the command list is currently executing.          |
| [Size](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/size.md)               | The current size in bytes used by commands in the command list. |

## Methods

| Method                                                                                                                     | Description                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [Add](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/add.md)                                         | Adds multiple new nodes that have a specified parent node to the hierarchy.                               |
| [Clear](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/clear.md)                                     | Clears all commands from the command list.                                                                |
| [ClearProperty](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/clearproperty.md)                     | Clears a property value for the specified hierarchy node.                                                 |
| [Detach](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/detach.md)                                   | Severs a hierarchy node from its parent, without removing it from the hierarchy.                          |
| [DetachChildren](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/detachchildren.md)                   | Severs every child of a hierarchy node from it, without removing them from the hierarchy.                 |
| [Dispose](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/dispose.md)                                 | Disposes the command list and releases its memory.                                                        |
| [Execute](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/execute.md)                                 | Executes all the commands in the hierarchy command list.                                                  |
| [ExecuteIncremental](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/executeincremental.md)           | Executes one command from the hierarchy command list.                                                     |
| [ExecuteIncrementalTimed](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/executeincrementaltimed.md) | Executes commands from the hierarchy command list until a time limit is reached.                          |
| [Remove](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/remove.md)                                   | Removes a node from the hierarchy.                                                                        |
| [RemoveChildren](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/removechildren.md)                   | Recursively removes all children of a node.                                                               |
| [Reserve](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/reserve.md)                                 | Reserves memory for nodes to use. Use this to avoid memory allocation hits when you add batches of nodes. |
| [SetChildrenNeedsSorting](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/setchildrenneedssorting.md) | Marks a hierarchy node as requiring sorting of its children in the next sorting operation.                |
| [SetDirty](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/setdirty.md)                               | Force an update of the hierarchy, even if no changes are pending.                                         |
| [SetName](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/setname.md)                                 | Sets a name for a hierarchy node.                                                                         |
| [SetParent](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/setparent.md)                             | Sets the parent node of a hierarchy node.                                                                 |
| [SetProperty](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/setproperty.md)                         | Sets a value for a property of a hierarchy node                                                           |
| [SetSortIndex](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/setsortindex.md)                       | Sets the sorting index for a hierarchy node.                                                              |
| [SortChildren](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/sortchildren.md)                       | Sorts the child nodes of a hierarchy node by their sort index.                                            |
| [SortChildrenRecursive](/engine/6000.7/script-reference/unity/hierarchy/hierarchycommandlist/sortchildrenrecursive.md)     | Recursively sorts the child nodes of a hierarchy node by their sort index.                                |
