Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

TerrainData

class in UnityEngine

/

Hereda de:Object

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual

Descripción

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.

Variables

alphamapHeightHeight of the alpha map.
alphamapLayersNumber of alpha map layers.
alphamapResolutionResolution of the alpha map.
alphamapTexturesAlpha map textures used by the Terrain. Used by Terrain Inspector for undo.
alphamapWidthWidth of the alpha map.
baseMapResolutionResolution of the base map used for rendering far patches on the terrain.
detailHeightDetail height of the TerrainData.
detailPrototypesContains the detail texture/meshes that the terrain has.
detailResolutionDetail Resolution of the TerrainData.
detailWidthDetail width of the TerrainData.
heightmapHeightHeight of the terrain in samples (Read Only).
heightmapResolutionResolution of the heightmap.
heightmapScaleThe size of each heightmap sample.
heightmapWidthWidth of the terrain in samples (Read Only).
sizeThe total size in world units of the terrain.
splatPrototypesSplat texture used by the terrain.
thicknessThe thickness of the terrain used for collision detection.
treeInstanceCountReturns the number of tree instances.
treeInstancesContains the current trees placed in the terrain.
treePrototypesThe list of tree prototypes this are the ones available in the inspector.
wavingGrassAmountAmount of waving grass in the terrain.
wavingGrassSpeedSpeed of the waving grass.
wavingGrassStrengthStrength of the waving grass in the terrain.
wavingGrassTintColor of the waving grass that the terrain has.

Funciones Públicas

GetAlphamapsReturns the alpha map at a position x, y given a width and height.
GetDetailLayerReturns a 2D array of the detail object density in the specific location.
GetHeightObtiene la altitud en el punto x, y indicado.
GetHeightsGet an array of heightmap samples.
GetInterpolatedHeightGets an interpolated height at a point x,y.
GetInterpolatedNormalGet an interpolated normal at a given location.
GetSteepnessObtiene la altitud en el punto x, y indicado.
GetSupportedLayersReturns an array of all supported detail layer indices in the area.
GetTreeInstanceGet 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.
RefreshPrototypesReloads all the values of the available prototypes (ie, detail mesh assets) in the TerrainData Object.
SetAlphamapsAssign all splat values in the given map area.
SetDetailLayerSets the detail layer density map.
SetDetailResolutionSet the resolution of the detail map.
SetHeightsSet an array of heightmap samples.
SetHeightsDelayLODSet an array of heightmap samples.
SetTreeInstanceSet 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.

Miembros heredados

Variables

hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameEl nombre del objeto.

Funciones Públicas

GetInstanceIDReturns the instance id of the object.
ToStringDevuelve el nombre del objeto.

Funciones Estáticas

DestroyElimina un gameobject, componente o asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateDevuelve el nombre del objeto.

Operadores

bool¿Existe el objeto?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.