# Tilemap.TileArray

> A read-only array containing Tile EntityId s.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.Tilemaps](/engine/6000.6/script-reference/unityengine/tilemaps.md)
* **Assembly:** UnityEngine.TilemapModule
* **Implements:** [IEnumerable\<TileBase>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public struct Tilemap.TileArray : IEnumerable<TileBase>, IEnumerable, IDisposable
```

## Remarks

This can be accessed by index to return a [TileBase](/engine/6000.6/script-reference/unityengine/tilemaps/tilebase.md).

## Constructors

| Constructor                                                                                                                                                          | Description                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| [TileArray(System.Int32,Unity.Collections.Allocator)](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray/ctor.md#tilearray\(int-allocator\))     | Creates a new array and allocates enough memory to fit the provided number of elements.                                   |
| [TileArray(System.Int32,Unity.Collections.MemoryLabel)](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray/ctor.md#tilearray\(int-memorylabel\)) | Creates a new array and allocates enough memory to fit the provided number of elements, using the specified memory label. |

## Properties

| Property                                                                                   | Description                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [this\[\]](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray/item.md) | Returns the [TileBase](/engine/6000.6/script-reference/unityengine/tilemaps/tilebase.md) indexed in the [Tilemap.TileArray](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray.md). |
| [Length](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray/length.md) | The number of elements in the [Tilemap.TileArray](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray.md).                                                                           |

## Methods

| Method                                                                                                   | Description                                                                                                                                                                   |
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Dispose](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray/dispose.md)             | Frees allocated memory for the [Tilemap.TileArray](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray.md).                                                |
| [GetEnumerator](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray/getenumerator.md) | Retrieves an iterator that allows you to iterate over all elements within the [Tilemap.TileArray](/engine/6000.6/script-reference/unityengine/tilemaps/tilemap/tilearray.md). |
