SetParent
Sets the parent of a hierarchy node.
Read time 1 minuteLast updated 14 days ago
Definition
- Type: Method
- Namespace: Unity.Hierarchy
- Assembly: UnityEngine.HierarchyCoreModule
SetParent(HierarchyNode, HierarchyNode)
Sets the parent of a hierarchy node.
public void SetParent(in HierarchyNode node, in HierarchyNode parent)
Parameters
SetParent(HierarchyNode, HierarchyNode, int)
Sets the parent of a hierarchy node.
public void 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.
Remarks
The index maximum value is the parent's child count, or child count minus one if moving within the same parent.