Method TryGetLayer
TryGetLayer(int, out TilemapLayer?)
Get the Tilemap
Parameters
index
intThe index of the Tilemap
Layer element to locate.layer
TilemapLayer When this method returns true, contains the Tilemap
Layer element located; otherwise, null.
Returns
- bool
true if a Tilemap
Layer element was located at the specified index in this Tilemap; otherwise, false. This method return false when the specified index is less than zero or is greater than or equal to the total number of TilemapLayer elements in this Tilemap.
TryGetLayer(string, out TilemapLayer?)
Gets the Tilemap
Parameters
name
stringThe name of the Tilemap
Layer element to locate.layer
TilemapLayer When this method returns true, contains the Tilemap
Layer element located; otherwise, null.
Returns
- bool
true if a Tilemap
Layer element was located in this Tilemap with the specified name; otherwise false. This method returns false if this Tilemap does not contain a TilemapLayer element with the specified name.