Tiles are Assets that are arranged on Tilemaps to construct a 2D environment. Each Tile references a selected Sprite, which is then rendered at the Tile’s location on the Tilemap Grid. Refer to Creating Tiles for more information about preparing and importing sprites for your Tiles, and the different methods for creating the Assets in the Editor.
属性 | 功能 |
---|---|
Preview | 显示所选瓦片的视觉效果预览。 |
Sprite | 选择要在此瓦片上渲染的精灵。单击右侧的圆圈图标可打开对象选择器窗口,然后从可用的精灵资源中进行选择,或者将精灵直接拖到此框中。 |
Color | 使用所选颜色为此瓦片上放置的精灵进行着色。设置为白色时,将渲染没有色调的精灵。 |
Collider Type | 定义为瓦片生成的碰撞体的形状。 |
None | 不生成碰撞体。 |
Sprite | The Collider shape is generated based on the selected Sprite’s outline. |
Grid | The Collider shape is based on a cell of the Tilemap. The shape of a cell depends on the Cell Layout of the Tilemap. |
The Collider Type set in the Tile Asset’s properties affects the generation of Collider shapes for each Tile in the Tilemap. The component’s shape generation behavior corresponds to the Collider Types in the following ways:
碰撞体类型 | 功能 |
---|---|
无 | Tilemap Collider 2D 组件不会为此瓦片生成任何碰撞体形状。 |
Sprite | The Tilemap Collider 2D component generates a Collider shape based on the Sprite assigned to the Tile. The Collider shape is based on the Custom Physics Shape set for the Sprite. |
Grid | Tilemap Collider 2D 组件基于网格单元格的形状(由 Grid 组件的选定单元格布局确定)生成碰撞体形状。 |
页面内容和屏幕截图更新于 2020.1 NewIn20201 在 2017.2 版中添加了瓦片地图 NewIn20172