Search Unity

Questions about Canvas.SetMaterial, and IMaterialModifier

Discussion in 'UGUI & TextMesh Pro' started by pushxtonotdie, Feb 10, 2020.

  1. pushxtonotdie

    pushxtonotdie

    Joined:
    Oct 21, 2010
    Posts:
    111
    I have a bit of confusion about the functionality in UGUI with materials. It seems that Canvas.SetMaterial throws errors, and seems like perhaps it is erroneously exposed. I would usually use IMaterialModifier, but it looks like this is potentially getting deprecated (it isn't in newer versions of the docs). It is also possible to set this directly on the Graphic I believe. What is the best way to set materials on UGUI objects?