Version: 2020.2
Importing and preparing Sprites for an Isometric Tilemap
创建用于等距瓦片地图的瓦片面板

创建等距瓦片地图

创建__等距瓦片地图 (Isometric Tilemap)__ 时,与创建常规瓦片地图相比,还需要执行其他步骤。要创建等距瓦片地图,请选择 GameObject > 2D Object > Isometric Tilemap/Isometric Z as Y Tilemap

创建等距瓦片地图后,还需要通过项目和网格设置进行其他设置,才能正确渲染等距瓦片地图。

自定义轴排序

To render the Tiles of an Isometric Tilemap, Tiles placed further to the ‘back’ of the Tilemap need to be rendered first before those in front to create the pseudo-depth of an isometric perspective. To ensure that all Renderers in the Scene conform to this logic, a Custom Axis is used as the Sorting Axis. Set the Transparency Sort Mode to ‘Custom Axis’ and enter (0,1,0) for the XYZ values of the Transparency Sort Axis.

选择 Edit > Project Settings…> Graphics > Camera Settings 来设置“Custom Axis”设置。

Transparency Sort Axis 设置
Transparency Sort Axis 设置

Set the Transparency Sort Axis XYZ values to (0,1,0) to cause all Renderers which are at a higher Y position in the Scene to be rendered first, and appear behind Renderers at a lower Y position.

使用 Isometric Z as Y Tilemap 选项时,具有不同 Z 位置值的瓦片会沿 Y 轴偏移并且看起来处于不同的高度,从而在相同的 XY 单元位置处产生与瓦片的“堆叠”效果。默认情况下,通用的等距 Transparency Sort Axis 设置 (0,1,0) 不会在排序期间考虑瓦片的 Z 位置值,因此会导致瓦片不按预期顺序渲染(请参阅下面的示例)。

左:__设置为 (0,1,0) 时,瓦片渲染顺序不正确。右:__设置为 (0,1,-0.26) 时,瓦片正确叠加在一起。
左:__设置为 (0,1,0) 时,瓦片渲染顺序不正确。右:__设置为 (0,1,–0.26) 时,瓦片正确“叠加”在一起。

Set the Transparency Sort Axis to (0,1,–0.26) to correctly render Tiles with different Z positions. The Z-axis is set to –0.26 to give a bias to Tiles with higher Z positions to be drawn first.

Grid Cell Size 设置

具有默认等距布局 (Isometric Layout) 设置的网格
具有默认等距布局 (Isometric Layout) 设置的网格
Isometric Creates an Isometric Tilemap with the default settings.
Isometric Z As Y Creates an Isometric Tilemap where a Tile’s Z-axis value is added to its Y-axis value. This causes the Tile to be visually offset along the Y-axis by that value, creating the illusion of height as the Tiles are placed on the Tilemap.

等距瓦片地图使用__二维投影__或真__等距投影__平行投影角度。有关这两种投影形式的更多信息,请参阅此文章以获取更多详细信息。

Changing the Cell Size of the Grid component changes the size of angles that make up each Cell, which affects the type of projection being simulated. By default, Cell Size of the Isometric Cell Layout is (1, 0.5, 1) which simulates dimetric projection angles. To simulate true isometric projection angles instead, set the Y value to ‘0.57735’.


  • 2018.3 版中添加了等距瓦片地图 NewIn20183
Importing and preparing Sprites for an Isometric Tilemap
创建用于等距瓦片地图的瓦片面板