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
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961