文档

Unity Engine

Unity Engine

TreeView

Creates a TreeView with all default properties.
阅读时间1 分钟最后更新于 1 个月前

Definition

TreeView()

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

Remarks

Use BaseTreeView.SetRootItems 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 BaseTreeView.SetRootItems 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 BaseTreeView.SetRootItems to add content.