Version: 2020.2
Experimental: this API is experimental and might be changed or removed in the future.

PaintContext.Cleanup

切换到手册
public void Cleanup (bool restoreRenderTexture);

参数

restoreRenderTexture 为 true 时,指示此函数恢复 RenderTexture.active

描述

释放此 PaintContext 的已分配资源。

此函数释放 sourceRenderTexture 和 /destinationRenderTexture/。 restoreRenderTexture 为 true 时,它还将 RenderTexture.active 恢复为已另存为 _oldRenderTexture 的值。 TerrainPaintUtility.EndPaintHeightmapTerrainPaintUtility.EndPaintTextureTerrainPaintUtility.ReleaseContextResources 在内部调用此函数。