# tilemapTilesChanged

> Callback when Tiles on a Tilemap have changed, without allocating.

## Definition

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

```csharp
[NoAutoStaticsCleanup]
public static event Action<Tilemap, NativeArray<Tilemap.SyncTile>, TileChangeReason> tilemapTilesChanged
```

### Remarks

This returns the cells which have been updated and why. The cells are only valid for the duration of the callback.

### Examples

```csharp
 // Log the cells which have changed, ignoring changes which cannot affect collision
using Unity.Collections;
using UnityEngine;
using UnityEngine.Tilemaps;

public class ExampleClass : MonoBehaviour
{
    void OnEnable()
    {
        Tilemap.tilemapTilesChanged += OnTilesChanged;
    }

    void OnDisable()
    {
        Tilemap.tilemapTilesChanged -= OnTilesChanged;
    }

    void OnTilesChanged(Tilemap tilemap, NativeArray<Tilemap.SyncTile> entries, TileChangeReason reason)
    {
        if ((reason & TileChangeReason.Physics) == 0)
            return;

        for (var i = 0; i < entries.Length; ++i)
        {
            var entry = entries[i];
            Debug.Log(entry.hasTile ? $"{entry.position} has a Tile" : $"{entry.position} is empty");
        }
    }
}
```
