# ToggleSelected

> Toggles the selection state of the specified node.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Hierarchy](/engine/6000.6/script-reference/unity/hierarchy.md)
* **Assembly:** UnityEngine.HierarchyModule

## ToggleSelected(HierarchyNode)

Toggles the selection state of the specified node.

```csharp
public void ToggleSelected(in HierarchyNode node)
```

### Parameters

**** (\[HierarchyNode]\(/engine/6000.6/script-reference/unity/hierarchy/hierarchynode)): The [HierarchyNode](/engine/6000.6/script-reference/unity/hierarchy/hierarchynode.md) to toggle the selection state of.

## ToggleSelected(ReadOnlySpan\<HierarchyNode>)

Toggles the selection state of the specified nodes.

```csharp
public void ToggleSelected(ReadOnlySpan<HierarchyNode> nodes)
```

### Parameters

**** (\[ReadOnlySpan\<HierarchyNode>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The [HierarchyNode](/engine/6000.6/script-reference/unity/hierarchy/hierarchynode.md)s to toggle the selection state of.
