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 the Creating Tiles documentation for 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 | 基于所选__精灵__的轮廓生成碰撞体形状。 |
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. |
为瓦片地图中的每个瓦片生成的碰撞体形状取决于__瓦片资源__的属性中设置的碰撞体类型。组件的形状生成行为与__碰撞体类型__的对应关系如下:
碰撞体类型 | 功能 |
---|---|
None | 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