除常规瓦片地图外,Unity 还提供 Hexagonal Point Top Tilemap 和 Hexagonal Flat Top Tilemap 瓦片地图。六角形瓦片通常用于战略类桌面游戏,因为它们的中心与边上的任何点之间具有一致的距离,并且相邻的瓦片总是共享边。因此,这些瓦片非常适合构建几乎任何类型的大型游戏区域,并让玩家做出关于移动和定位的战术决策。
The Hexagonal Tilemap uses an offset coordinate system, where alternative rows or columns are offset by half a cell when aligning the cells to the hexagonal grid. For Hexagonal Point Top Tilemaps, every odd row is offset to the right by half a cell’s width. For Hexagonal Flat Top Tilemaps, every odd column is offset to the top by half a cell’s height.
Example: Hexagonal Point Top Tilemap. Offset rows are colored in yellow.
Example: Hexagonal Flat Top Tilemap. Offset columns are colored in yellow.
要创建__六边形瓦片地图 (Hexagonal Tilemap),请按照与创建常规瓦片地图相同的步骤操作(菜单:__GameObject > 2D Object__),但在 2D Object__ 菜单中选择 Hexagonal 选项之一。
选择与当前使用的六边形瓦片方向相匹配的 Hexagonal Tilemap 选项。以下是 Hexagonal Point Top Tilemap 和 Hexagonal Flat Top Tilemap 的示例。
为六边形瓦片地图创建__瓦片面板 (Tile Palette)__ 时,将 Tile Palette 的 Grid 设置设为 Hexagon__,并将 Hexagon Type__ 设置为与当前使用的瓦片地图和瓦片相匹配的六角形类型,如下所示。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.