文档

Unity Engine

Unity Engine

Add

Adds a new node that has a specified parent node to the hierarchy.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: Unity.Hierarchy
  • Assembly: UnityEngine.HierarchyCoreModule

Add(HierarchyNode, HierarchyNode)

Adds a new node that has a specified parent node to the hierarchy.
public bool Add(in HierarchyNode parent, out HierarchyNode node)

Parameters

The parent of the new node.

The new node if the command succeeds.

Returns

Type

Description

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

Add(HierarchyNode, int, HierarchyNode[])

Adds multiple new nodes that have a specified parent node to the hierarchy.
public bool Add(in HierarchyNode parent, int count, out HierarchyNode[] nodes)

Parameters

The parent of the new nodes.

count

The number of nodes to create.

The new nodes if the command succeeds.

Returns

Type

Description

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

Add(HierarchyNode, Span<HierarchyNode>)

Adds multiple new nodes that have a specified parent node to the hierarchy.
public bool Add(in HierarchyNode parent, Span<HierarchyNode> outNodes)

Parameters

The parent of the new nodes.

The span of nodes filled with new nodes if the command succeeds.

Returns

Type

Description

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