TerrainData

class in UnityEngine

/

Hereda de:Object

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.
boundsThe local bounding box of the TerrainData object.
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

hideFlags¿Debería el objeto estar oculto, guardado con la escena o modificable por el usuario?
nameEl nombre del objeto.

Funciones Públicas

GetInstanceIDDevuelve el id de la instancia del objeto.
ToStringReturns the name of the GameObject.

Funciones Estáticas

DestroyElimina un gameobject, componente o asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadHace que el objeto target no sea destruido automáticamente cuando se cargue una nueva escena.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateClona el objeto original y devuelve el clon.

Operadores

bool¿Existe el objeto?
operator !=Compare si dos objetos se refieren a un objeto diferente.
operator ==Compara dos referencias de objeto para ver si se refieren al mismo objeto.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961