ドキュメント

Unity Engine

Unity Engine

SetParent

Sets the parent node of a hierarchy node.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

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
true
if the command was appended to the list,
false
otherwise.

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.

index

The index at which to insert the node in the parent's children list.

Returns

Type

Description

bool
true
if the command was appended to the list,
false
otherwise.

Remarks

The index maximum value is the parent's child count, or child count minus one if moving within the same parent.