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'.
阅读时间1 分钟最后更新于 21 天前
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'.
public void SetMaterial(Material material, int index)
Parameters
Remarks
Additional Resources: CanvasRenderer.materialCount, CanvasRenderer.SetTexture
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'.
public void SetMaterial(Material material, Texture texture)
Parameters
Remarks
Additional Resources: CanvasRenderer.materialCount, CanvasRenderer.SetTexture