UnityEngine.CanvasRenderer.SetMaterial C# (CSharp) Method

SetMaterial() public method

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'. See Also: CanvasRenderer.SetMaterialCount, CanvasRenderer.SetTexture.

public SetMaterial ( Material material, Texture texture ) : void
material Material Material for rendering.
texture Texture Material texture overide.
return void
        public void SetMaterial(Material material, Texture texture)
        {
            this.materialCount = Math.Max(1, this.materialCount);
            this.SetMaterial(material, 0);
            this.SetTexture(texture);
        }

Same methods

CanvasRenderer::SetMaterial ( Material material, int index ) : void

Usage Example

コード例 #1
0
 public void SetMaterial(Material material, UnityEngine.Color ac)
 {
     if (canvasRenderer.GetMaterial() != material)
     {
         canvasRenderer.SetMaterial(material, null);
     }
     additionalColor = ac;
     buffer.modified = true;
 }
All Usage Examples Of UnityEngine.CanvasRenderer::SetMaterial