Version: Unity 6 (6000.0)
Language : English
Scriptable Tile assets
Create a scriptable tile

Scriptable tiles

Scriptable tiles are tiles that you can assign behavior scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
to and you can paint with the scriptable tiles on a TilemapA GameObject that allows you to quickly create 2D levels using tiles and a grid overlay. More info
See in Glossary
component.

These C# scripts allow you to customize how the tile interacts with other tiles or other behaviours defined by the TileBase class.

All tiles added to a Tilemap component must inherit from TileBase. TileBase provides a tilemap with a fixed set of APIs to communicate its rendering properties. For most cases of the APIs, the location of the tile and the instance of the tilemap the tile is placed on is passed in as arguments of the API. You can use this to find any required attributes for setting the tile information.

The most common methods to override are:

  • RefreshTile determines which Tiles in the vicinity are updated when this Tile is added to the Tilemap.
  • GetTileData determines what the Tile looks like on the Tilemap.
Scriptable Tile assets
Create a scriptable tile