C# Class UnityEngine.TerrainData

Inheritance: Object
显示文件 Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Private Properties

Property Type Description
AddTree void
AddUser void
GetAdjustedSize int
GetAlphamapTexture Texture2D
GetAlphamaps float[,,]
GetDetailLayer ].int[
GetHeight float
GetHeights ].float[
GetInterpolatedHeight float
GetSteepness float
GetSupportedLayers int[]
HasUser bool
INTERNAL_CALL_GetInterpolatedNormal void
INTERNAL_CALL_GetTreeInstance void
INTERNAL_CALL_RemoveTrees int
INTERNAL_CALL_SetTreeInstance void
INTERNAL_get_bounds void
INTERNAL_get_heightmapScale void
INTERNAL_get_size void
INTERNAL_get_wavingGrassTint void
INTERNAL_set_size void
INTERNAL_set_wavingGrassTint void
Internal_Create void
Internal_GetMaximumAlphamapResolution int
Internal_GetMaximumBaseMapResolution int
Internal_GetMaximumDetailPatchCount int
Internal_GetMaximumDetailResolutionPerPatch int
Internal_GetMaximumResolution int
Internal_GetMinimumAlphamapResolution int
Internal_GetMinimumBaseMapResolution int
Internal_GetMinimumDetailResolutionPerPatch int
Internal_SetAlphamaps void
Internal_SetDetailLayer void
Internal_SetDetailResolution void
Internal_SetHeights void
Internal_SetHeightsDelayLOD void
NeedUpgradeScaledTreePrototypes bool
RecalculateBasemapIfDirty void
RecalculateTreePositions void
RefreshPrototypes void
RemoveDetailPrototype void
RemoveTreePrototype void
RemoveTrees int
RemoveUser void
ResetDirtyDetails void
SetBasemapDirty void
UpgradeScaledTreePrototype void

Public Methods

Method Description
GetInterpolatedNormal ( float x, float y ) : Vector3

Get an interpolated normal at a given location.

GetTreeInstance ( int index ) : TreeInstance

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

SetAlphamaps ( int x, int y, float map ) : void
SetDetailLayer ( int xBase, int yBase, int layer, int details ) : void
SetDetailResolution ( int detailResolution, int resolutionPerPatch ) : void

Set the resolution of the detail map.

SetHeights ( int xBase, int yBase, float heights ) : void
SetHeightsDelayLOD ( int xBase, int yBase, float heights ) : void
SetTreeInstance ( int index, TreeInstance instance ) : void

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

TerrainData ( ) : System

Private Methods

Method Description
AddTree ( TreeInstance &tree ) : void
AddUser ( GameObject user ) : void
GetAdjustedSize ( int size ) : int
GetAlphamapTexture ( int index ) : Texture2D
GetAlphamaps ( int x, int y, int width, int height ) : float[,,]
GetDetailLayer ( int xBase, int yBase, int width, int height, int layer ) : ].int[
GetHeight ( int x, int y ) : float
GetHeights ( int xBase, int yBase, int width, int height ) : ].float[
GetInterpolatedHeight ( float x, float y ) : float
GetSteepness ( float x, float y ) : float
GetSupportedLayers ( int xBase, int yBase, int totalWidth, int totalHeight ) : int[]
HasUser ( GameObject user ) : bool
INTERNAL_CALL_GetInterpolatedNormal ( TerrainData self, float x, float y, Vector3 &value ) : void
INTERNAL_CALL_GetTreeInstance ( TerrainData self, int index, TreeInstance &value ) : void
INTERNAL_CALL_RemoveTrees ( TerrainData self, Vector2 &position, float radius, int prototypeIndex ) : int
INTERNAL_CALL_SetTreeInstance ( TerrainData self, int index, TreeInstance &instance ) : void
INTERNAL_get_bounds ( Bounds &value ) : void
INTERNAL_get_heightmapScale ( Vector3 &value ) : void
INTERNAL_get_size ( Vector3 &value ) : void
INTERNAL_get_wavingGrassTint ( Color &value ) : void
INTERNAL_set_size ( Vector3 &value ) : void
INTERNAL_set_wavingGrassTint ( Color &value ) : void
Internal_Create ( [ terrainData ) : void
Internal_GetMaximumAlphamapResolution ( ) : int
Internal_GetMaximumBaseMapResolution ( ) : int
Internal_GetMaximumDetailPatchCount ( ) : int
Internal_GetMaximumDetailResolutionPerPatch ( ) : int
Internal_GetMaximumResolution ( ) : int
Internal_GetMinimumAlphamapResolution ( ) : int
Internal_GetMinimumBaseMapResolution ( ) : int
Internal_GetMinimumDetailResolutionPerPatch ( ) : int
Internal_SetAlphamaps ( int x, int y, int width, int height, float map ) : void
Internal_SetDetailLayer ( int xBase, int yBase, int totalWidth, int totalHeight, int detailIndex, int data ) : void
Internal_SetDetailResolution ( int patchCount, int resolutionPerPatch ) : void
Internal_SetHeights ( int xBase, int yBase, int width, int height, float heights ) : void
Internal_SetHeightsDelayLOD ( int xBase, int yBase, int width, int height, float heights ) : void
NeedUpgradeScaledTreePrototypes ( ) : bool
RecalculateBasemapIfDirty ( ) : void
RecalculateTreePositions ( ) : void
RefreshPrototypes ( ) : void
RemoveDetailPrototype ( int index ) : void
RemoveTreePrototype ( int index ) : void
RemoveTrees ( Vector2 position, float radius, int prototypeIndex ) : int
RemoveUser ( GameObject user ) : void
ResetDirtyDetails ( ) : void
SetBasemapDirty ( bool dirty ) : void
UpgradeScaledTreePrototype ( ) : void

Method Details

GetInterpolatedNormal() public method

Get an interpolated normal at a given location.

public GetInterpolatedNormal ( float x, float y ) : Vector3
x float
y float
return Vector3

GetTreeInstance() public method

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

public GetTreeInstance ( int index ) : TreeInstance
index int The index of the tree instance.
return TreeInstance

SetAlphamaps() public method

public SetAlphamaps ( int x, int y, float map ) : void
x int
y int
map float
return void

SetDetailLayer() public method

public SetDetailLayer ( int xBase, int yBase, int layer, int details ) : void
xBase int
yBase int
layer int
details int
return void

SetDetailResolution() public method

Set the resolution of the detail map.

public SetDetailResolution ( int detailResolution, int resolutionPerPatch ) : void
detailResolution int Specifies the number of pixels in the detail resolution map. A larger detailResolution, leads to more accurate detail object painting.
resolutionPerPatch int Specifies the size in pixels of each individually rendered detail patch. A larger number reduces draw calls, but might increase triangle count since detail patches are culled on a per batch basis. A recommended value is 16. If you use a very large detail object distance and your grass is very sparse, it makes sense to increase the value.
return void

SetHeights() public method

public SetHeights ( int xBase, int yBase, float heights ) : void
xBase int
yBase int
heights float
return void

SetHeightsDelayLOD() public method

public SetHeightsDelayLOD ( int xBase, int yBase, float heights ) : void
xBase int
yBase int
heights float
return void

SetTreeInstance() public method

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

public SetTreeInstance ( int index, TreeInstance instance ) : void
index int The index of the tree instance.
instance TreeInstance The new TreeInstance value.
return void

TerrainData() public method

public TerrainData ( ) : System
return System