Version: 2021.2
public void SetTexture (string name, Texture value);
public void SetTexture (int nameID, Texture value);
public void SetTexture (string name, RenderTexture value, Rendering.RenderTextureSubElement element);
public void SetTexture (int nameID, RenderTexture value, Rendering.RenderTextureSubElement element);

参数

name 属性的名称。
nameID 通过 Shader.PropertyToID 检索的属性的名称 ID。
value 要设置的 Texture
element Optional parameter that specifies the type of data to set from the RenderTexture.

描述

设置纹理属性。

向代码块添加属性。如果具有给定名称的纹理属性已存在,则替换旧值。

By specifying a `RenderTextureSubElement`, you can indicate which type of data to set from the RenderTexture. The possible options are: RenderTextureSubElement.Color, RenderTextureSubElement.Depth, and RenderTextureSubElement.Stencil.

另请参阅:SetColorSetVectorSetFloatSetMatrixRenderTextureSubElement

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