Item node to show and select in a TreeView window, optional to include child nodes.
More...
Inherits IEnumerable< TreeNode >.
Public Member Functions | |
| TreeNode (string label, params TreeNode[] nodes) | |
Initialize with specified label and child nodes. More... | |
| TreeNode (GUIContent label, params TreeNode[] nodes) | |
Initialize with specified label and child nodes. More... | |
| TreeNode (string label, bool enable, bool expand=false, params TreeNode[] nodes) | |
Initialize with specified label, default states, and child nodes. More... | |
| TreeNode (GUIContent label, bool enable, bool expand=false, params TreeNode[] nodes) | |
Initialize with specified label, default states, and child nodes. More... | |
| TreeNode (object data, string label, bool enable=false) | |
Initialize an end node with custom data and label. More... | |
| TreeNode(object data, GUIContent label, bool enable=false) IEnumerable< TreeNode > | GetNodes (int depth) |
Initialize an end node with custom data and label. More... | |
| IEnumerator< TreeNode > | GetEnumerator () |
Return an enumerator that iterates through the nodes collection. More... | |
| override string | ToString () |
Return a string of the label and data. More... | |
Public Attributes | |
| readonly GUIContent | label |
The label to show in the TreeView. More... | |
| readonly IEnumerable< TreeNode > | nodes |
| The child nodes. More... | |
| readonly IEnumerable< TreeNode > | all |
| All nodes include this and all progenies. More... | |
| readonly IEnumerable< TreeNode > | ends |
| All the end nodes which have no children. More... | |
| bool | enable |
| The flag if this be checked. More... | |
| bool | expand |
| The flag if expand to show child nodes. More... | |
| object | data |
| The custom data set and used by the creator. More... | |
Item node to show and select in a TreeView window, optional to include child nodes.
It's designed to allow assigning child nodes only when constructor to avoid self looping. Implement System.Collections.Generic.IEnumerable to iterate through the nodes.
3
Initialize with specified label and child nodes.
| label | Label. |
| nodes | Nodes. |
Initialize with specified label and child nodes.
| label | Label. |
| nodes | Nodes. |
Initialize with specified label, default states, and child nodes.
| label | Label. |
| enable | If set to true enable. |
| expand | If set to true expand. |
| nodes | Nodes. |
Initialize with specified label, default states, and child nodes.
| label | Label. |
| enable | If set to true enable. |
| expand | If set to true expand. |
| nodes | Nodes. |
| TreeNode | ( | object | data, |
| string | label, | ||
| bool | enable = false |
||
| ) |
Initialize an end node with custom data and label.
| data | Data. |
| label | Label. |
| enable | If set to true enable. |
| TreeNode (object data, GUIContent label, bool enable = false) IEnumerable<TreeNode> GetNodes | ( | int | depth | ) |
Initialize an end node with custom data and label.
| data | Data. |
| label | Label. |
| enable | If set to true enable. |
Get the progeny nodes by the specified depth, e.g., 0 is self, 2 is grandchildren.
| depth | Depth. |
| IEnumerator<TreeNode> GetEnumerator | ( | ) |
Return an enumerator that iterates through the nodes collection.
| override string ToString | ( | ) |
Return a string of the label and data.
string represents this.| readonly GUIContent label |
The label to show in the TreeView.
| readonly IEnumerable<TreeNode> nodes |
The child nodes.
| readonly IEnumerable<TreeNode> all |
All nodes include this and all progenies.
| readonly IEnumerable<TreeNode> ends |
All the end nodes which have no children.
| bool enable |
The flag if this be checked.
| bool expand |
The flag if expand to show child nodes.
| object data |
The custom data set and used by the creator.