The TerrainData class stores heightmaps, detail mesh positions, tree instances, and terrain texture alpha maps.
The Terrain component links to the terrain data and renders it.
alphamapHeight | Height of the alpha map. |
alphamapLayers | Number of alpha map layers. |
alphamapResolution | Resolution of the alpha map. |
alphamapTextureCount | Returns the number of alphamap textures. |
alphamapTextures | Alpha map textures used by the Terrain. Used by Terrain Inspector for undo. |
alphamapWidth | Width of the alpha map. |
baseMapResolution | Resolution of the base map used for rendering far patches on the terrain. |
bounds | The local bounding box of the TerrainData object. |
detailHeight | Detail height of the TerrainData. |
detailPatchCount | The number of patches along a terrain tile edge. This is squared to make a grid of patches. |
detailPrototypes | Contains the detail texture/meshes that the terrain has. |
detailResolution | Detail Resolution of the TerrainData. |
detailResolutionPerPatch | Detail Resolution of each patch. A larger value will decrease the number of batches used by detail objects. |
detailWidth | Detail width of the TerrainData. |
heightmapHeight | Height of the terrain in samples (Read Only). |
heightmapResolution | Resolution of the heightmap. |
heightmapScale | The size of each heightmap sample. |
heightmapTexture | Returns the heightmap texture. |
heightmapWidth | Width of the terrain in samples (Read Only). |
size | The total size in world units of the terrain. |
terrainLayers | Retrieves the terrain layers used by the current terrain. |
thickness | The thickness of the terrain used for collision detection. |
treeInstanceCount | Returns the number of tree instances. |
treeInstances | Contains the current trees placed in the terrain. |
treePrototypes | The list of tree prototypes this are the ones available in the inspector. |
wavingGrassAmount | Amount of waving grass in the terrain. |
wavingGrassSpeed | Speed of the waving grass. |
wavingGrassStrength | Strength of the waving grass in the terrain. |
wavingGrassTint | Color of the waving grass that the terrain has. |
GetAlphamaps | Returns the alpha map at a position x, y given a width and height. |
GetAlphamapTexture | Returns the alphamap texture at the specified index. |
GetDetailLayer | Returns a 2D array of the detail object density in the specific location. |
GetHeight | Gets the height at a certain point x,y. |
GetHeights | Get an array of heightmap samples. |
GetInterpolatedHeight | Gets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1]. |
GetInterpolatedNormal | Get an interpolated normal at a given location. |
GetMaximumHeightError | Returns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError. |
GetPatchMinMaxHeights | Returns an array of min max height values for all the renderable patches in a terrain. The returned array can be modified and then passed to OverrideMinMaxPatchHeights. |
GetSteepness | Gets the gradient of the terrain at point (x,y). |
GetSupportedLayers | Returns an array of all supported detail layer indices in the area. |
GetTreeInstance | Get the tree instance at the specified index. It is used as a faster version of treeInstances[index] as this function doesn't create the entire tree instances array. |
OverrideMaximumHeightError | Override the maximum tessellation height error with user provided values. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script. |
OverrideMinMaxPatchHeights | Override the minimum and maximum patch heights for every renderable terrain patch. Note that the overriden values get reset when the terrain resolution is changed and stays unchanged when the terrain heightmap is painted or changed via script. |
RefreshPrototypes | Reloads all the values of the available prototypes (ie, detail mesh assets) in the TerrainData Object. |
SetAlphamaps | Assign all splat values in the given map area. |
SetBaseMapDirty | Marks the terrain data as dirty to trigger an update of the terrain basemap texture. |
SetDetailLayer | Sets the detail layer density map. |
SetDetailResolution | Set the resolution of the detail map. |
SetHeights | Set an array of heightmap samples. |
SetHeightsDelayLOD | Set an array of heightmap samples. |
SetTreeInstance | Set the tree instance with new parameters at the specified index. However, TreeInstance.prototypeIndex and TreeInstance.position can not be changed otherwise an ArgumentException will be thrown. |
UpdateDirtyRegion | Triggers an update to integrate modifications done to the heightmap outside of unity. |
hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
name | The name of the object. |
GetInstanceID | Returns the instance id of the object. |
ToString | Returns the name of the object. |
Destroy | Removes a GameObject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
FindObjectOfType | Returns the first active loaded object of Type type. |
FindObjectsOfType | Returns a list of all active loaded objects of Type type. |
Instantiate | Clones the object original and returns the clone. |
bool | Does the object exist? |
operator != | Compares if two objects refer to a different object. |
operator == | Compares two object references to see if they refer to the same object. |