Search Unity

Excluding cginc/shader files from Custom Assemblies (asmdef)

Discussion in 'Editor & General Support' started by Aurelinator, Dec 27, 2017.

  1. Aurelinator

    Aurelinator

    Joined:
    Feb 27, 2012
    Posts:
    19
    When using the new Custom Assemblies feature, one of the annoying things is that every single generated project in the C# solution seems to contain a reference to every single .shader and .cginc file. I've got, for instance, a directory with 4 files that I want to be a small assembly, but the generated project looks like this:

    upload_2017-12-27_10-43-56.png

    The circled things are the only files that should be in the generated assembly. I know there's a way to show certain files in the assemblies in the Project Settings under Editor:

    upload_2017-12-27_10-45-9.png

    But at some point I think .shader and .cginc and one other type got included by default in EVERY project. Since I, as a developer almost never work with the shaders, I'd love to not have the shaders show up in every single project that's generated. It clutters the view and makes it really annoying.

    Is there a way to make the C# projects NOT include those additional files?

    Thanks
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  3. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    181
    Are there any news? at least Unity 2017.4.1f1 and Visual Studio 15.6.7 still have this issue.
     
  4. Bas-Smit

    Bas-Smit

    Joined:
    Dec 23, 2012
    Posts:
    274
    I use the attached script to sanitize the solution. It leaves one instance of every duplicated file in its actual project, and can exclude reference and files all together.
     

    Attached Files: