TerrainRegion
An area of a Terrain that TerrainEditUtility edits or measures.
Read time 1 minuteLast updated 22 days ago
Definition
- Type: Class
- Namespace: UnityEditor.TerrainTools
- Assembly: UnityEditor
public sealed class TerrainRegion
Remarks
Positions are in meters on the X and Z axes of the Terrain's local space: (0, 0) is the corner at the Terrain's position and (TerrainData.size.x, TerrainData.size.z) is the opposite corner. Vector2.y and Rect.y hold the Z coordinate. A region can extend past the Terrain; only the part on the Terrain is used.
A region is immutable. Create one with TerrainRegion.Rectangle, TerrainRegion.Circle, TerrainRegion.Path or TerrainRegion.Intersect, or use TerrainRegion.whole.
Static Properties
Property | Description |
|---|---|
| whole | The whole Terrain. |
Methods
Method | Description |
|---|---|
| Contains | Checks whether a position lies inside the region. |
| GetWeight | Gets how strongly an edit of this region applies at a position. |