22 lines
503 B
C#
22 lines
503 B
C#
|
|
#nullable enable
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace UVC.UI.List.Tree
|
||
|
|
{
|
||
|
|
public class TreeList : MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField]
|
||
|
|
protected TreeListItem itemPrefab;
|
||
|
|
public TreeListItem ItemPrefab => itemPrefab;
|
||
|
|
|
||
|
|
[SerializeField]
|
||
|
|
protected RectTransform root;
|
||
|
|
|
||
|
|
public void AddItem(TreeListItemData data)
|
||
|
|
{
|
||
|
|
TreeListItem item = GameObject.Instantiate<TreeListItem>(ItemPrefab, root);
|
||
|
|
item.Init(data, this);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|