# GetEnumerator()

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

## Definition

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

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

### Returns

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