SetTexture
Set a texture property.
阅读时间2 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
SetTexture(string, Texture)
Set a texture property.
public void SetTexture(string name, Texture value)
Parameters
Remarks
Adds a property to the block. If a texture property with the given name already exists, the old value is replaced.
By specifying a , you can indicate which type of data to set from the RenderTexture. The possible options are: RenderTextureSubElement.Color, RenderTextureSubElement.Depth, and RenderTextureSubElement.Stencil.
RenderTextureSubElementAdditional Resources: MaterialPropertyBlock.SetColor, MaterialPropertyBlock.SetVector, MaterialPropertyBlock.SetFloat, MaterialPropertyBlock.SetMatrix, RenderTextureSubElement.
SetTexture(int, Texture)
Set a texture property.
public void SetTexture(int nameID, Texture value)
Parameters
The name ID of the property retrieved by Shader.PropertyToID.
Remarks
Adds a property to the block. If a texture property with the given name already exists, the old value is replaced.
By specifying a , you can indicate which type of data to set from the RenderTexture. The possible options are: RenderTextureSubElement.Color, RenderTextureSubElement.Depth, and RenderTextureSubElement.Stencil.
RenderTextureSubElementAdditional Resources: MaterialPropertyBlock.SetColor, MaterialPropertyBlock.SetVector, MaterialPropertyBlock.SetFloat, MaterialPropertyBlock.SetMatrix, RenderTextureSubElement.
SetTexture(string, RenderTexture, RenderTextureSubElement)
Set a texture property.
public void SetTexture(string name, RenderTexture value, RenderTextureSubElement element)
Parameters
The name of the property.
The Texture to set.
Optional parameter that specifies the type of data to set from the RenderTexture.
Remarks
Adds a property to the block. If a texture property with the given name already exists, the old value is replaced.
By specifying a , you can indicate which type of data to set from the RenderTexture. The possible options are: RenderTextureSubElement.Color, RenderTextureSubElement.Depth, and RenderTextureSubElement.Stencil.
RenderTextureSubElementAdditional Resources: MaterialPropertyBlock.SetColor, MaterialPropertyBlock.SetVector, MaterialPropertyBlock.SetFloat, MaterialPropertyBlock.SetMatrix, RenderTextureSubElement.
SetTexture(int, RenderTexture, RenderTextureSubElement)
Set a texture property.
public void SetTexture(int nameID, RenderTexture value, RenderTextureSubElement element)
Parameters
The name ID of the property retrieved by Shader.PropertyToID.
The Texture to set.
Optional parameter that specifies the type of data to set from the RenderTexture.
Remarks
Adds a property to the block. If a texture property with the given name already exists, the old value is replaced.
By specifying a , you can indicate which type of data to set from the RenderTexture. The possible options are: RenderTextureSubElement.Color, RenderTextureSubElement.Depth, and RenderTextureSubElement.Stencil.
RenderTextureSubElement