要在场景中添加地形 (Terrain) 游戏对象,请从菜单中选择 GameObject > 3D Object > Terrain。此过程也会在 Project 视图中添加相应的地形资源。执行此操作时,景观最初是一个大型平坦的平面。地形的 Inspector 窗口提供了许多工具,可使用这些工具创建细节化的景观特征。
Inspector 中的地形编辑工具
工具栏提供了五个选项来调整地形:
如需了解每个图标的更多信息,请参阅 Create Neighbor Terrains、地形工具、树、草和其他细节和地形设置。
选择画笔图标可以访问绘制工具,这些工具允许您修改地形。使用光标可以雕刻地形的高度,或将纹理绘制到地形上。从几个内置画笔形状中进行选择,或使用纹理来自定义画笔。还可以更改画笔的大小和不透明度(应用效果的强度)。定义属性后,光标将变为所选画笔的形状。单击或拖动地形来创建不同的形状和纹理。
与在地形上使用画笔进行绘制的方式类似,您可以添加纹理、树和细节(比如草、花和岩石)。还可以创建其他连接的地形瓦片,更改整个瓦片的高度,甚至可以编写具有复杂效果的自定义画笔。
Terrain Inspector 在默认情况下启用了以下键盘快捷键。
按键 | 功能 |
---|---|
逗号 ( , ) 和句点 ( .) | 循环浏览可用的画笔 |
Shift-逗号 ( < ) 和 Shift-句点 ( > ) | 循环浏览树、纹理和细节的可用对象 |
左中括号 ( [ ) 和右中括号 ( ] ) | 减小并增大画笔大小 |
减号 ( - ) 和等号 ( = ) | 减小并增大画笔不透明度 |
要设置自定义的快捷键,请使用 Shortcuts Manager。
在 Category 下,选择 Terrain 以显示与地形相关的快捷键分配情况。有关设置和修改快捷键的更多信息,请参阅 Shortcuts Manager 页面。
此外,标准 F 键击操作对于地形而言的作用略有不同。由于地形通常非常大,因此按下 F 键时,Scene 视图会聚焦到光标当前所在的区域。这种机制提供了一种非常快速且直观的方式来跳转到您想要编辑的地形区域。如果在光标不在地形瓦片上时按 F 键,则恢复为标准框选行为,当光标位于 Scene 视图上时,按下此键会框选整个游戏对象。
2019–04–17 页面已修订
更新了内容以匹配新的 UI,并添加了有关键盘快捷键的信息
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.