SetParent
Sets the parent node of a hierarchy node.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.Hierarchy
- Assembly: UnityEngine.HierarchyCoreModule
SetParent(HierarchyNode, HierarchyNode)
Sets the parent node of a hierarchy node.
public bool SetParent(in HierarchyNode node, in HierarchyNode parent)
Parameters
The hierarchy node to set a parent for.
The hierarchy node to set as the parent node.
Returns
Type | Description |
|---|---|
| bool | |
SetParent(HierarchyNode, HierarchyNode, int)
Sets the parent node of a hierarchy node.
public bool SetParent(in HierarchyNode node, in HierarchyNode parent, int index)
Parameters
The hierarchy node.
The hierarchy node to set as a parent.
The index at which to insert the node in the parent's children list.
Returns
Type | Description |
|---|---|
| bool | |
Remarks
The index maximum value is the parent's child count, or child count minus one if moving within the same parent.