Terrain 组件负责渲染地形。
activeTerrain | The active Terrain. This is a convenient function to get to the main Terrain in the Scene. |
activeTerrains | 场景中激活的地形。 |
compressedHolesFormat | 地形孔洞纹理压缩后的图形格式。 |
compressedHolesTextureFormat | 地形孔洞纹理压缩后的纹理格式。 |
heightmapFormat | 地形高度贴图的图形格式。 |
heightmapRenderTextureFormat | 地形高度贴图的 RenderTextureFormat。 |
holesFormat | 地形孔洞纹理未压缩时的图形格式。 |
holesRenderTextureFormat | 地形孔洞纹理的渲染纹理格式。 |
normalmapFormat | 地形法线贴图纹理的图形格式。 |
normalmapRenderTextureFormat | 地形法线贴图纹理的渲染纹理格式。 |
normalmapTextureFormat | 地形法线贴图纹理的纹理格式。 |
allowAutoConnect | 指定地形区块是否将自动连接到相邻区块。 |
bakeLightProbesForTrees | Whether to bake an array of internal light probes for Tree Editor trees (Editor only). |
basemapDistance | 超出底图距离的高度贴图斑块将使用预先计算的低分辨率底图。 |
bottomNeighbor | 地形底部邻居。 |
collectDetailPatches | 回收内存中的细节斑块。 |
deringLightProbesForTrees | Removes ringing from light probes on Tree Editor trees (Editor only). |
detailObjectDensity | 细节对象的密度。 |
detailObjectDistance | 如果不超出该距离,则显示细节对象。 |
drawHeightmap | Indicates whether Unity draws the Terrain geometry itself. |
drawInstanced | 设置为 true 可启用地形实例渲染器。默认值为 false。 |
drawTreesAndFoliage | 指定是否应绘制地形树和细节。 |
editorRenderFlags | 控制应渲染地形的哪个部分。 |
enableHeightmapRayTracing | When this options is enabled, Terrain heightmap geometries will be added in acceleration structures used for Ray Tracing. |
groupingID | 用于自动连接的分组 ID。 |
heightmapMaximumLOD | Limits the Terrain's maximum rendering resolution. |
heightmapMinimumLODSimplification | Limits how simplified the rendered terrain can be. |
heightmapPixelError | 切换细节级别时,最坏情况下地形将弹出多少个像素(近似值)。 |
ignoreQualitySettings | When enabled, the terrain ignores the terrain overrides set in the QualitySettings. |
keepUnusedRenderingResources | Defines whether Unity frees per-Camera rendering resources for the Terrain when those resources aren't in use after a certain number of frames. |
leftNeighbor | The Terrain tile to the left, which is in the negative X direction. |
lightmapIndex | 应用到该地形的烘焙光照贴图的索引。 |
lightmapScaleOffset | 用于烘焙光照贴图的 UV 缩放和偏移。 |
materialTemplate | The custom material Unity uses to render the Terrain. |
normalmapTexture | 返回通过高度贴图采样计算出的法线贴图纹理。仅在使用实例化渲染地形时使用纹理。 |
patchBoundsMultiplier | 设置地形包围盒缩放。 |
preserveTreePrototypeLayers | 允许指定 Unity 如何为树实例选择层。 |
realtimeLightmapIndex | 应用到该地形的实时光照贴图的索引。 |
realtimeLightmapScaleOffset | 用于实时光照贴图的 UV 缩放和偏移。 |
reflectionProbeUsage | 如何在地形上使用反射探针。请参阅 ReflectionProbeUsage。 |
renderingLayerMask | 确定地形渲染器所在的渲染层。 |
rightNeighbor | The Terrain tile to the left, which is in the positive X direction. |
shadowCastingMode | 用于设置地形的阴影投射模式。 |
terrainData | 存储高度贴图、地形纹理、细节网格和树的地形数据。 |
topNeighbor | 地形顶部邻居。 |
treeBillboardDistance | 到摄像机的距离(如果超过该距离,则仅将树渲染为公告牌)。 |
treeCrossFadeLength | 使用树来从公告牌方向过渡到网格方向的总距离增量。 |
treeDistance | 渲染树木的最大距离。 |
treeLODBiasMultiplier | 用于渲染细节级别树(即 SpeedTree 树)的当前细节级别偏差的乘数。 |
treeMaximumFullLODCount | 以完整细节级别渲染的树的最大数量。 |
treeMotionVectorModeOverride | The motion vector rendering mode for all SpeedTree models painted on the terrain. |
AddTreeInstance | 向地形添加树实例。 |
Flush | 刷新在地形中完成的任何更改,以使其生效。 |
GetClosestReflectionProbes | 将其 AABB 与地形的 AABB 相交的反射探针填充到列表中。此外,还将提供其权重。权重表示探针对地形的影响程度,在多个反射探针之间发生混合时使用。 |
GetKeepUnusedCameraRenderingResources | |
GetPosition | 获取地形的位置。 |
GetSplatMaterialPropertyBlock | 通过复制到 dest MaterialPropertyBlock 对象来获取之前设置的泼溅材质属性。 |
SampleHeight | Samples the height at the given position defined in world space, relative to the Terrain space. |
SetKeepUnusedCameraRenderingResources | Defines whether Unity cleans up rendering resources for a given Camera during garbage collection. |
SetNeighbors | Lets you set up the connection between neighboring Terrain tiles. This ensures LOD matches up on neighboring Terrain tiles. |
SetSplatMaterialPropertyBlock | 在使用泼溅材质渲染地形高度贴图时设置其他材质属性。 |
CreateTerrainGameObject | 从 TerrainData 创建包含碰撞体的地形。 |
GetActiveTerrains | Populates a List of Terrains with the active Terrains in the Scene. |
SetConnectivityDirty | 将当前连接状态标记为无效。 |
enabled | 启用的 Behaviour 可更新,禁用的 Behaviour 不可更新。 |
isActiveAndEnabled | Reports whether a GameObject and its associated Behaviour is active and enabled. |
gameObject | 此组件附加到的游戏对象。始终将组件附加到游戏对象。 |
tag | 此游戏对象的标签。 |
transform | 附加到此 GameObject 的 Transform。 |
hideFlags | 该对象应该隐藏、随场景一起保存还是由用户修改? |
name | 对象的名称。 |
BroadcastMessage | 调用此游戏对象或其任何子项中的每个 MonoBehaviour 上名为 methodName 的方法。 |
CompareTag | Checks the GameObject's tag against the defined tag. |
GetComponent | Gets a reference to a component of type T on the same GameObject as the component specified. |
GetComponentInChildren | Gets a reference to a component of type T on the same GameObject as the component specified, or any child of the GameObject. |
GetComponentInParent | Gets a reference to a component of type T on the same GameObject as the component specified, or any parent of the GameObject. |
GetComponents | Gets references to all components of type T on the same GameObject as the component specified. |
GetComponentsInChildren | Gets references to all components of type T on the same GameObject as the component specified, and any child of the GameObject. |
GetComponentsInParent | Gets references to all components of type T on the same GameObject as the component specified, and any parent of the GameObject. |
SendMessage | 调用此游戏对象中的每个 MonoBehaviour 上名为 methodName 的方法。 |
SendMessageUpwards | 调用此游戏对象中的每个 MonoBehaviour 上或此行为的每个父级上名为 methodName 的方法。 |
TryGetComponent | 获取指定类型的组件(如果存在)。 |
GetInstanceID | Gets the instance ID of the object. |
ToString | 返回对象的名称。 |
Destroy | 移除 GameObject、组件或资源。 |
DestroyImmediate | 立即销毁对象 /obj/。强烈建议您改用 Destroy。 |
DontDestroyOnLoad | 在加载新的 Scene 时,请勿销毁 Object。 |
FindAnyObjectByType | Retrieves any active loaded object of Type type. |
FindFirstObjectByType | Retrieves the first active loaded object of Type type. |
FindObjectsByType | Retrieves a list of all loaded objects of Type type. |
Instantiate | 克隆 original 对象并返回克隆对象。 |
bool | 该对象是否存在? |
operator != | 比较两个对象是否引用不同的对象。 |
operator == | 比较两个对象引用,判断它们是否引用同一个对象。 |
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.