Version: 2021.2
Sprite Shape Renderer
Grid

Tilemap

The Tilemap component is a system which stores and handles Tile Assets for creating 2D levels. It transfers the required information from the Tiles placed on it to other related components such as the Tilemap Renderer and the Tilemap Collider 2D. This package is not included in the Unity Editor default installation by default, and you will need to download the 2D Tilemap Editor package via the Package Manager.

创建瓦片地图时,Grid 组件自动作为瓦片地图的父级,并在将瓦片布置到瓦片地图上时作为参照。

要创建、修改和选择要绘制到瓦片地图上的瓦片,请使用 Tile Palette(菜单:__Window > 2D > Tile Palette__)及其工具。请参阅有关 Tile Palette 和绘制瓦片地图的文档以了解更多信息。

Tilemap property window.
Tilemap property window.
属性 功能
Animation Frame Rate Unity 播放瓦片动画的速率。增加或减少此值会根据等效因子更改速度(例如,如果将此值设置为 2,Unity 将以两倍速度播放瓦片动画)。
Color 选择一种颜色应用为此瓦片地图上的瓦片的色调。设置为白色(默认颜色)可使 Unity 不带色调地渲染瓦片。
Tile Anchor 输入瓦片地图上沿 XYZ 轴偏移瓦片锚点位置的数量(以单元格为单位)。
Orientation 选择瓦片地图上瓦片的方向。如果需要在特定平面定位瓦片,请使用此属性。
    XY Unity 在 XY 平面上定位瓦片。
    XZ Unity 在 XZ 平面上定位瓦片。
    YX Unity 在 YX 平面上定位瓦片。
    YZ Unity 在 YZ 平面上定位瓦片。
    ZX Unity 在 ZX 平面上定位瓦片。
    ZY Unity 在 ZY 平面上定位瓦片。
    Custom 选择此选项可启用以下自定义方向设置。
Position 设置自定义方向的位置偏移。默认情况下禁用此选项,在 Tilemap 的方向设置为 Custom 时启用。
Rotation 设置自定义方向的旋转。默认情况下禁用此选项,在 Tilemap 的方向设置为 Custom 时启用。
Scale 设置自定义方向的比例。默认情况下禁用此选项,在 Tilemap 的方向设置为 Custom 时启用。
Info Expand this to show the Assets used in the Tilemap.
    Tiles Shows a list of Tile Assets used in the Tilemap.
    Sprites Shows a list of Sprites used in the Tilemap.

GitHub 中的 2D Extras

可从 2D Extra GitHub 代码仓库下载脚本化瓦片画笔的示例。可从 2D Techdemos Github 代码仓库获取包含这些脚本化游戏对象的示例项目。有关不同脚本和用法信息的描述,请参阅每个代码仓库的 README.md。


  • Page content and screenshot updated for 2021.1 NewIn20211 *页面内容和屏幕截图更新于 2020.1 NewIn20201
  • 2D Tilemap Editor 不再随 Editor 安装过程一起安装,而是必须从 Package Manager 下载。2019.2 NewIn20192
  • 在 Unity 2018.3 中添加了等距瓦片地图 (Isometric Tilemap) 功能 NewIn20183
  • 在 Unity 2018.2 中添加了六边形瓦片地图 (Hexagonal Tilemap) 功能 NewIn20182
  • 2017.2 版中添加了瓦片地图 NewIn20172
Sprite Shape Renderer
Grid
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961