除了常规的 瓦片地图一个允许您通过瓦片和网格叠加快速创建2D级别的GameObject。 更多信息
参见 词汇表 外,Unity还提供了两种六边形瓦片地图:六边形顶点向上和六边形顶面平齐。六边形瓦片常用于策略桌面游戏,因为它们中心到其边缘任何点的距离一致,且相邻瓦片总是共享边缘。这使得它们非常适合构建几乎任何类型的大型游乐区域,并允许玩家做出有关移动和定位的策略性决策。
六边形瓦片地图使用偏移坐标系统,当将单元格对齐到六边形网格时,交替的行或列会偏移半个单元格。对于六边形顶点向上瓦片地图,每个奇数行向右偏移半个单元格的宽度。对于六边形顶面平齐瓦片地图,每个奇数列向上偏移半个单元格的高度。
要创建 六边形瓦片地图,请按照创建常规 瓦片地图 的相同步骤(菜单:GameObject > 2D Object)进行操作,但在 2D Object二维GameObject,例如瓦片地图或精灵。 更多信息
参见 词汇表 菜单中选择一个六边形选项。
选择与您使用的六边形瓦片朝向匹配的 六边形瓦片地图 选项。以下是一个 六边形顶点向上瓦片地图 和一个 六边形顶面平齐瓦片地图 的示例。
当为六边形瓦片地图创建 瓦片调色板 时,将 瓦片调色板 的 网格 设置为 六边形,并选择与您使用的瓦片地图和瓦片匹配的 六边形类型,如下所示。
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.