TerrainData

class in UnityEngine

/

Inherits from:Object

Switch to Manual

Description

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

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

Variables

alphamapHeightВысота альфа карты.
alphamapLayersКоличество слоев альфа карты.
alphamapResolutionРазрешение альфа карты.
alphamapTextureCountReturns the number of alphamap textures.
alphamapTexturesТекстуры альфа карты, используемые ландшафтом. Для отмены используйте Inspector ландшафта.
alphamapWidthШирина альфа карты.
baseMapResolutionРазрешение базовой карты, используемое для визуализации далеких участков ландшафта.
boundsThe local bounding box of the TerrainData object.
detailHeightДетализированная высота TerrainData.
detailPatchCountThe number of patches along a terrain tile edge. This is squared to make a grid of patches.
detailPrototypesСодержит детализированную текстуру/сетку ландшафта.
detailResolutionДетализированное разрешение TerrainData.
detailResolutionPerPatchДетализация разрешения для каждого участка ландшафта. Более высокое значение будет увеличивать детализацию объектов.
detailWidthДетализированная ширина TerrainData.
heightmapHeightВысота ландшафта в образцах (Read Only).
heightmapResolutionРазрешение карты высот.
heightmapScaleРазмер каждого образца карты высот.
heightmapTextureReturns the heightmap texture.
heightmapWidthШирина ландшафта в образцах (Read Only).
sizeОбщий размер в мировых единицах ландшафта.
terrainLayersRetrieves the terrain layers used by the current terrain.
thicknessThe thickness of the terrain used for collision detection.
treeInstanceCountReturns the number of tree instances.
treeInstancesСодержит текущие деревья, размещенные на ландшафте.
treePrototypesСписок прототип деревьев, доступен в инспекторе.
wavingGrassAmountВеличина размаха травы на ландшафте.
wavingGrassSpeedСкорость размаха травы.
wavingGrassStrengthСила размаха травы на ландшафте.
wavingGrassTintЦвет размаха травы ландшафта.

Public Functions

GetAlphamapsВозвращает альфа карту в позиции x,y, учитывая ширину и высоту.
GetAlphamapTextureReturns the alphamap texture at the specified index.
GetDetailLayerВозвращает 2D массив объектов детализированной плоскости в определенном месте.
GetHeightПолучает высоту в определенной точке x,y.
GetHeightsПолучает массив образцов карты высот.
GetInterpolatedHeightGets an interpolated height at a point x,y. The x and y coordinates are clamped to [0, 1].
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.
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.
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.
UpdateDirtyRegionTriggers an update to integrate modifications done to the heightmap outside of unity.

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.
FindObjectsOfTypeReturns a list of all active 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.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961