I can’t find this answer anywhere. I just want to know if both an original graphic, as well as the spritesheet it gets put onto are included in the build.
Anything that isn’t directly referenced won’t be included in a build. You can look in the build log to see this. (As long as you avoid the Resources folder, which includes everything.)
–Eric
For clarity’s sake, and this is somewhat tangential, but…
It’s true that anything that isn’t directly referenced won’t be included in a build, but the exception to that is shaders. Any shader files you have in your Assets folder will be included in a build whether you are using them or not. If you have any problems with shader compilation when making builds, a good thing to look at is whether you have a bunch of shaders in your project folders. They get included and add to the compilation cost, which can lead quickly to “shader keywords exceeded” errors on build.
Anyway… carry on.
Hmm, I don’t think so. I’ve never seen that behavior, and if it was true, the Graphics project setting (“Always included shaders”) would have no reason to exist. Although it’s true that there is one exception, namely scripts. All scripts are always included regardless of being referenced, since there’s no guaranteed way of determining which ones aren’t.
–Eric
It depends on the shader apparently, and if they’re set in the shader code for multi-compile, which many are, so if you’re using Marmoset Skyshop, for instance, this is a known problem.
From the Unity page on multi-compile shaders: “When using shader variants, you should bear in mind that there is a limit of 64 keywords in Unity and a few of these are used internally and therefore subtract from the limit. Also, the keywords are enabled globally throughout a particular Unity project so you should be careful not to exceed the limit when multiple keywords are defined in several different shaders.” - Unity
Also from a thread here in the forum: “…Fixed this issue by removing unused Shader Assets from my project. Not very happy considering they were Assets purchased before running into this issue. Unity adds in every shader with multi_compile regardless of whether they are actually used in the project or not.” - radimoto
Another thread: “This counts all the keywords ever seen, in the whole project. Basically, each keyword is assigned a number, and there can only be 64 of them. In all shaders in the whole project that were ever loaded.” - Aras
Right so, just be careful to not include shaders you don’t need. Not sure this is the case with Unity 5 though, needs checking.
OK, that’s actually a different issue. Anyway, I didn’t really answer the original question correctly since I remember reading there’s a bug/issue with the original textures and the resulting atlas both being included in builds.
–Eric
Yup I just thought I would clarify that some things do actually get included in a build when you don’t know they are, and I used some keywords in my post so anyone looking for info about it will hopefully find this thread.
Hmm, that sounds like a big bug. Especially because the docs on Shader.Find mention this:
“When building a player, a shader will only be included if it is assigned to a material that is used in any scene or if the shader is placed in a “Resources” folder.”
The docs are still correct. The issue with shaders doesn’t have anything to do with what’s included in a build.
–Eric