Version: Unity 6 Preview (6000.0)
LanguageEnglish
  • C#

CanvasRenderer.SetMaterial

Declaration

public void SetMaterial(Material material, int index);

Declaration

public void SetMaterial(Material material, Texture texture);

Parameters

material Material for rendering.
texture Material texture overide.
index Material index.

Description

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.