Version: 2023.1
public void SetMaterial (Material material, int index);
public void SetMaterial (Material material, Texture texture);

参数

material 用于渲染的材质。
texture 材质纹理覆盖。
index 材质索引。

描述

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.materialCount, CanvasRenderer.SetTexture.