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

PaintContext.Scatter

切换到手册
public void Scatter (Func<ITerrainInfo,RenderTexture> terrainDest, Material blitMaterial, int blitPass, Action<ITerrainInfo> beforeBlit, Action<ITerrainInfo> afterBlit);

参数

terrainDest 返回要为每个地形写入的 RenderTexture 的函数。
blitMaterial 用于复制数据的材质。如果为 null,则使用默认 blit 材质。
blitPass 用于复制数据的材质通道。其默认值为 0。
beforeBlit 要在复制到每个地形之前调用的可选操作。
afterBlit 要在复制到每个地形之后调用的可选操作。

描述

通过将修改复制回用户为源地形瓦片指定的 RenderTextures,应用已编辑的 PaintContext。

完成对 PaintContext 的编辑之后,此函数将 destinationRenderTexture 中的已修改数据应用于为每个地形存储的数据。 Scatter 对 terrainDest 指定的一组 RenderTextures 执行此复制。

此函数使用以下步骤分散到 PaintContext 中的每个地形:
1) 调用 terrainDest 以获取目标 RenderTexture。
2) 调用 /beforeBlit/。
3) 使用 blitMaterialblitPassdestinationRenderTexture 复制到目标 RenderTexture 中。
4) 调用 /afterBlit/。

另请参阅:PaintContextPaintContext.Gather

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961