Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. 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.