This version of Unity is unsupported.

Tilemap.size

public Vector3Int size;

Description

The size of the Tilemap in cells.

This takes into consideration only placed Tiles in the Tilemap.