TerrainToMeshPrototype class

The TerrainToMeshPrototype class stores Tree, Grass or DetailMesh prefab's location in the TerrainData object.

Properties

GameObject treePrefab

Reference to the tree prefab, in the case if current object represents a Tree.

Texture2D grassTexture

Reference to the texture, in the case if current object represents a Grass.

GameObject detailMeshPrefab

Reference to the detail mesh prefab, in the case if current object represents a DetailMesh.

int prototypeIndex

In the case of a Tree this is the index of object inside TerrainData.treePrototypes array.

In the case of a Grass or DetailMesh this is the index of object inside TerrainData.detailPrototypes array.

Vector3 position

Object's local position related to the terrain-space

Quaternion rotation

Object's local rotation related to the terrain-space.

Vector3 scale

Object's local scale related to the terrain-space.

Vector3 surfaceNormal

Terrain's surface normal vector direction at the point of this object's position.

Last updated