TerrainData

class in UnityEngine

/

Inherits from:Object

Switch to Manual

Description

Класс TerrainData содержит карты высот, позиции детализированного меша, экземпляры деревьев, текстуры ландшафта и альфа карты.

Компонент Terrain ссылается к данным ландшафта и визуализирует их.

Static Variables

AlphamapTextureNameThe name for the Terrain alpha map textures.
HolesTextureNameThe name for the Terrain holes Texture.

Variables

alphamapHeightHeight of the alpha map. (Read only.)
alphamapLayersКоличество слоев альфа карты.
alphamapResolutionThe size of the alpha map in texels for either the width or the height.
alphamapTextureCountReturns the number of alphamap textures.
alphamapTexturesТекстуры альфа карты, используемые ландшафтом. Для отмены используйте Inspector ландшафта.
alphamapWidthШирина альфа карты.
baseMapResolutionРазрешение базовой карты, используемое для визуализации далеких участков ландшафта.
boundsThe local bounding box of the TerrainData object.
detailHeightThe resolution of the detail data stored in TerrainData.
detailPatchCountThe number of patches along a terrain tile edge. This is squared to make a grid of patches.
detailPrototypesContains the detail texture/meshes that the Terrain has.
detailResolutionДетализированное разрешение TerrainData.
detailResolutionPerPatchДетализация разрешения для каждого участка ландшафта. Более высокое значение будет увеличивать детализацию объектов.
detailWidthThe resolution of the detail data stored in TerrainData.
enableHolesTextureCompressionEnable the Terrain holes Texture compression.
heightmapResolutionThe size of the heightmap in texels for either the width or the height.
heightmapScaleReturns a Vector3 where the x and z components are the size of each heightmap sample (i.e. the space between two neighboring heightmap samples), and the y component is the entire Terrain's height range in world space.
heightmapTextureReturns the heightmap texture.
holesResolutionReturns the Terrain holes resolution for both the data and the Texture.
holesTextureReturns the Terrain holes Texture.
sizeОбщий размер в мировых единицах ландшафта.
terrainLayersRetrieves the terrain layers used by the current terrain.
treeInstanceCountReturns the number of tree instances.
treeInstancesСодержит текущие деревья, размещенные на ландшафте.
treePrototypesСписок прототип деревьев, доступен в инспекторе.
wavingGrassAmountВеличина размаха травы на ландшафте.
wavingGrassSpeedСкорость размаха травы.
wavingGrassStrengthСила размаха травы на ландшафте.
wavingGrassTintЦвет размаха травы ландшафта.

Public Functions

CopyActiveRenderTextureToHeightmapCopies the specified part of the active RenderTexture to the Terrain heightmap texture.
CopyActiveRenderTextureToTextureCopies the specified part of the active RenderTexture to the Terrain texture.
DirtyHeightmapRegionMarks the specified part of the heightmap as dirty.
DirtyTextureRegionMarks the specified part of the Terrain texture as dirty.
GetAlphamapsВозвращает альфа карту в позиции x,y, учитывая ширину и высоту.
GetAlphamapTextureReturns the alphamap texture at the specified index.
GetDetailLayerReturns a 2D array of the detail object density (i.e. the number of detail objects for this layer) in the specific location.
GetHeightGets the world space height of the Terrain at a certain point x,y without adding the Terrain's world position y.
GetHeightsGets an array of heightmap samples.
GetHolesGets an array of Terrain holes samples.
GetInterpolatedHeightGets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1].
GetInterpolatedHeightsGets an array of terrain height values using the normalized x,y coordinates.
GetInterpolatedNormalПолучает интерполированный нормаль в текущей локации.
GetMaximumHeightErrorReturns an array of tesselation maximum height error values per renderable terrain patch. The returned array can be modified and passed to OverrideMaximumHeightError.
GetPatchMinMaxHeightsReturns 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Получает градиент ландшафта в точке <x,y>.
GetSupportedLayersВозвращает массив индексов всех поддерживаемых детализированных слоев в области.
GetTreeInstanceGets 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.
IsHoleGets whether a certain point at x,y is a hole.
OverrideMaximumHeightErrorOverride 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.
OverrideMinMaxPatchHeightsOverride 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Перезагружает все значения доступных прототипов (т.е. ассеты детализированного меша) в объекте TerrainData.
SetAlphamapsНазначает все значения в текущей области карты.
SetBaseMapDirtyMarks the terrain data as dirty to trigger an update of the terrain basemap texture.
SetDetailLayerНазначьте детализированный слой плотности карты.
SetDetailResolutionSets the resolution of the detail map.
SetHeightsSets an array of heightmap samples.
SetHeightsDelayLODSets an array of heightmap samples.
SetHolesSets an array of Terrain holes samples.
SetHolesDelayLODSets an array of Terrain holes samples.
SetTerrainLayersRegisterUndoThis function sets the terrainLayers property, and in addition, registers the action to the Editor's undo stack.
SetTreeInstanceSets the tree instance with new parameters at the specified index. However, you cannot change TreeInstance.prototypeIndex and TreeInstance.position. If you change them, the method throws an ArgumentException.
SetTreeInstancesSets the Tree Instance array, and optionally snaps Trees onto the surface of the Terrain heightmap.
SyncHeightmapPerforms synchronization queued by previous calls to CopyActiveRenderTextureToHeightmap and DirtyHeightmapRegion, which makes the height data and LOD data used for tessellation up to date.
SyncTexturePerforms synchronization queued by previous calls to CopyActiveRenderTextureToTexture and DirtyTextureRegion, which makes CPU data of the Terrain textures up to date.

Inherited members

Variables

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Functions

GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the object.

Static Functions

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes 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.