# GetEnumerator()

> Retrieves an iterator that allows you to iterate over all elements within the Tilemap.TileArray.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Tilemaps](/engine/6000.7/script-reference/unityengine/tilemaps.md)
* **Assembly:** UnityEngine.TilemapModule

```csharp
public readonly IEnumerator<TileBase> GetEnumerator()
```

### Returns

| Type                                                                                                      | Description                                                                                                                                                         |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [IEnumerator\<TileBase>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1) | An iterator that allows you to iterate over all elements within the [Tilemap.TileArray](/engine/6000.7/script-reference/unityengine/tilemaps/tilemap/tilearray.md). |
