Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Scripting Material constructor obsolete -- documentation clarification?

Discussion in '5.4 Beta' started by syscrusher, Jun 8, 2016.

  1. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    On the page for Material.Material() in the C# scripting manual, "Obsolete Creating materials from shader source string is no longer supported. Use Shader assets instead."

    The two function signatures shown there, Material(Shader ...) and Material(Material ...), are accepting non-string parameters.

    I have code that creates a Material from a Shader object, and I'm wondering if this is obsolete, or if the comment means exactly what it says, that you can't create a Material by passing a string to the constructor.

    Can someone please clarify? Thanks!
     
  2. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I found this post, which seems to suggest it's a documentation issue, and that only inline shader source is obsoleted.