SetupParentsAndChildrenFromDepths(TreeViewItem, IList<TreeViewItem>)
Utility method for initializing all the parent and children properties of the rows using the order and the depths values that have been set.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEditor.IMGUI.Controls
- Assembly: UnityEditor.CoreModule
protected static void SetupParentsAndChildrenFromDepths(TreeViewItem root, IList<TreeViewItem> rows)
Parameters
The hidden root item.
TreeViewItems where only the depth property have been set.
Remarks
Some tree data models are based on order and depth information only. This method can be called after creating all the rows to initalize the ‘parent’ and ‘children’ properties for each TreeViewItem in ‘rows’ based on the depth information for each item. This method assumes that the data presented in is in the order it should appear from top to bottom in the TreeView.
rowsAdditional Resources: TreeView.SetupDepthsFromParentsAndChildren, TreeView.BuildRoot.