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. |
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. |
detailHeight | Detail height of the TerrainData. |
detailPrototypes | Contains the detail texture/meshes that the terrain has. |
detailResolution | Detail Resolution of the TerrainData. |
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. |
heightmapWidth | Width of the terrain in samples (Read Only). |
size | The total size in world units of the terrain. |
splatPrototypes | Splat texture used by the 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. |
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. |
GetInterpolatedNormal | Get an interpolated normal at a given location. |
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. |
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. |
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. |
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 game object. |
Destroy | Removes a gameobject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. |
DontDestroyOnLoad | Makes the object target not be destroyed automatically 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 | Returns a copy of the object original. |
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. |