Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TreeView

Creates a TreeView with all default properties.
Read time 1 minuteLast updated 7 days ago

Definition

TreeView()

Creates a TreeView with all default properties.
public TreeView()

Remarks

Use SetRootItems_1 to add content.

TreeView(Func<VisualElement>, Action<VisualElement, int>)

Creates a TreeView with specified factory methods.
public TreeView(Func<VisualElement> makeItem, Action<VisualElement, int> bindItem)

Parameters

The factory method to call to create a display item. The method should return a VisualElement that can be bound to a data item.

The method to call to bind a data item to a display item. The method receives as parameters the display item to bind, and the index of the data item to bind it to.

Remarks

Use SetRootItems_1 to add content.

TreeView(int, Func<VisualElement>, Action<VisualElement, int>)

Creates a TreeView with specified factory methods using the fixed height virtualization method.
public TreeView(int itemHeight, Func<VisualElement> makeItem, Action<VisualElement, int> bindItem)

Parameters

itemHeight

The item height to use in FixedHeight virtualization mode.

The factory method to call to create a display item. The method should return a VisualElement that can be bound to a data item.

The method to call to bind a data item to a display item. The method receives as parameters the display item to bind, and the index of the data item to bind it to.

Remarks

Use SetRootItems_1 to add content.