SetMaterial
Set the material for the canvas renderer. If a texture is specified then it will be used as the 'MainTex' instead of the material's 'MainTex'. Additional Resources: CanvasRenderer.materialCount, CanvasRenderer.SetTexture.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.UIModule
SetMaterial(Material, int)
Set the material for the canvas renderer. If a texture is specified then it will be used as the 'MainTex' instead of the material's 'MainTex'. Additional Resources: CanvasRenderer.materialCount, CanvasRenderer.SetTexture.
public void SetMaterial(Material material, int index)
Parameters
SetMaterial(Material, Texture)
Set the material for the canvas renderer. If a texture is specified then it will be used as the 'MainTex' instead of the material's 'MainTex'. Additional Resources: CanvasRenderer.materialCount, CanvasRenderer.SetTexture.
public void SetMaterial(Material material, Texture texture)