Version: 2019.2
LanguageEnglish
  • C#
Experimental: this API is experimental and might be changed or removed in the future.

PaintContext Constructor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

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

Parameters

terrainTerrain that defines terrain space for this PaintContext.
pixelRectPixel rectangle to edit in the target terrain texture.
targetTextureWidthWidth of the target terrain texture (per Terrain).
targetTextureHeightHeight 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