This version of Unity is unsupported.
Experimental: this API is experimental and might be changed or removed in the future.

PaintContext Constructor

Declaration

public PaintContext(Terrain terrain, RectInt pixelRect, int targetTextureWidth, int targetTextureHeight);

Parameters

terrain Terrain that defines terrain space for this PaintContext.
pixelRect Pixel rectangle to edit in the target terrain texture.
targetTextureWidth Width of the target terrain texture (per Terrain).
targetTextureHeight Height of the target terrain texture (per Terrain).

Description

Creates a new PaintContext, to edit a target texture on a Terrain, in a region defined by pixelRect.

This constructor finds all Terrains that touch the pixelRect, searching across adjacent connected Terrains. It also calculates the relevant regions on each Terrain, as well as the transforms between them.

See Also: PaintContext