PaintContext(Terrain, RectInt, int, int, bool, bool)
Creates a new PaintContext, to edit a target texture on a Terrain, in a region defined by pixelRect.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Constructor
- Namespace: UnityEngine.TerrainTools
- Assembly: UnityEngine.TerrainModule
public PaintContext(Terrain terrain, RectInt pixelRect, int targetTextureWidth, int targetTextureHeight, bool sharedBoundaryTexel = true, bool fillOutsideTerrain = true)
Parameters
Terrain that defines terrain space for this PaintContext.
Pixel rectangle to edit in the target terrain texture.
Width of the target terrain texture (per Terrain).
Height of the target terrain texture (per Terrain).
Whether to stretch the Textures so that edge texels lie on the Terrain boundary, and are shared with connected Terrains.
Whether to fill empty space outside of the Terrain tiles with data from the nearest tile.
Remarks
This constructor finds all Terrain tiles that touch the pixelRect, searching across adjacent connected Terrain tiles. It also calculates the relevant regions on each Terrain, as well as the transforms between them.
Additional Resources: PaintContext.