# GetUsedSpritesNonAlloc(Sprite[])

> Fills the given array with the total number of different Sprite s used in the Tilemap and returns the number of Sprites filled.

## Definition

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

```csharp
public int GetUsedSpritesNonAlloc(Sprite[] usedSprites)
```

### Parameters

**** (\[Sprite\[]]\(/engine/6000.5/script-reference/unityengine/sprite)): The array to be filled.

### Returns

| Type                                                       | Description                   |
| ---------------------------------------------------------- | ----------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of Sprites filled. |

### Remarks

If the size of the given array is less than the total number of Sprites used in the Tilemap, this will try to fill the array as much as possible.
