# GetEnumerator()

> Returns this as an iterator that allows you to iterate over all positions within the RectInt.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public RectInt.PositionEnumerator GetEnumerator()
```

### Returns

| Type                                                                                            | Description                                                                                                   |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [PositionEnumerator](/engine/6000.6/script-reference/unityengine/rectint/positionenumerator.md) | This [RectInt.PositionEnumerator](/engine/6000.6/script-reference/unityengine/rectint/positionenumerator.md). |
