Search Unity

Bug Shader Graph package code is missing public class accessibility

Discussion in 'Shader Graph' started by MasonWheeler, Nov 12, 2020.

  1. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    219
    I decided to try and make a new node type, so I copied the code of an existing node into my project, only to have it fill up with errors because many of the types it's relying on, including AbstractMaterialNode, the base class for all shader graph nodes, are internal in the \Library\PackageCache\com.unity.shadergraph@7.3.1 code because they're missing the "public" accessibility modifier on their class definitions. In the Github repo for Shader Graph, these types are all marked as public, and have been since the beginning of the repo's version history.

    Why are the types not public in the Unity package, as the repo shows they're supposed to be? This makes it unnecessarily difficult to extend Shader Graph -- as you have to modify the accessibility manually -- and well-nigh impossible to distribute the extensions you produce, as anyone who wishes to use it will also have to modify the code manually, and a large portion of the target audience is comprised of people without a coding background.
     
  2. Oxeren

    Oxeren

    Joined:
    Aug 14, 2013
    Posts:
    121
    Yep, there is also some internal stuff in SRP sources that could be pretty helpful. Hope it's a temporary measure while they flesh out the public API.