# SetupDepthsFromParentsAndChildren(TreeViewItem<TIdentifier>)

> Utility method using the depth of the input TreeViewItem to set the correct depths for all its descendant TreeViewItems.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.6/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor.CoreModule

## SetupDepthsFromParentsAndChildren(TreeViewItem\<T>)

```csharp
protected static void SetupDepthsFromParentsAndChildren(TreeViewItem<TIdentifier> root)
```

### Parameters

**** (\[TreeViewItem\<T>]\(/engine/6000.6/script-reference/unityeditor/imgui/controls/treeviewitem)): TreeViewItem from which the descendentans should have their depth updated.

### Remarks

This method can be used to intitialize the TreeViewItems depth values after setting up the children properties of the TreeViewItems.

Additional Resources: [TreeView\<TIdentifier>.SetupDepthsFromParentsAndChildren](/engine/6000.6/script-reference/unityeditor/imgui/controls/treeview1/setupdepthsfromparentsandchildren.md), [TreeView\<TIdentifier>.BuildRoot()](/engine/6000.6/script-reference/unityeditor/imgui/controls/treeview1/buildroot.md).
