TerrainData

class in UnityEngine

/

다음으로부터 상속:Object

매뉴얼로 전환

설명

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.

변수

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.

Public 함수

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.
GetHeightGets the height at a certain point x,y.
GetHeightsGet an array of heightmap samples.
GetInterpolatedHeightGets an interpolated height at a point x,y.
GetInterpolatedNormalGet an interpolated normal at a given location.
GetSteepnessGets the gradient of the terrain at point (x,y).
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.

상속된 멤버

변수

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

Public 함수

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

정적 함수

DestroyRemoves a gameobject, component or 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.
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.

연산자

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