跳到主要内容
版本:3.0.x

Class TreeNode

树形结构的节点,持有用户数据并维护父子关系

Assembly: YooAsset.Editor.dll
View Source
Declaration
public class TreeNode

Properties

Children

子节点集合

View Source
Declaration
public List<TreeNode> Children { get; }

Parent

父节点

View Source
Declaration
public TreeNode Parent { get; set; }

UserData

用户数据

View Source
Declaration
public object UserData { get; set; }

IsExpanded

是否展开

View Source
Declaration
public bool IsExpanded { get; set; }

Methods

AddChild(TreeNode)

添加子节点

View Source
Declaration
public void AddChild(TreeNode child)
Parameters
TypeNameDescription
YooAsset.Editor.TreeNodechild要添加的子节点

ClearChildren()

清理所有子节点

View Source
Declaration
public void ClearChildren()

GetDepth()

计算节点在树中的深度

View Source
Declaration
public int GetDepth()
Returns

System.Int32: 从根节点到当前节点的层级数,根节点深度为 0。