"What is loaded" in a build

I’m afraid I’ve never really been able to find the doco for this basic question:

So you have a big project open and in the “Project” pane there are many many files and folders.

You may have many difference scenes, let’s say you are ONLY including “scene A” in the build.

I’m afraid I have absolutely no idea … WHAT gets included in the build?

here are some raw guesses I have made

  1. unity includes everything in “Project”

  2. unity includes only things you use explicitly in the scene in “Heirarchy” … and, there’s a little man inside the application who uses his inteligence to guess what other assets you may try to load at runtime!

  3. unity includes only things you use explicitly in the scene in “Heirarchy” , and, it also loads everythnig in the specially-named folders (resources/, etc)

Many questions arise … for example if you buy an asset store asset, and it has the typical 800 gb of example code … does it include all of those in the build??

What about this one … if you have a huge number of images - textures - in ordinary non-special-name folders, does it load all of those? or only the ones used in materials? or ???

What the hell is the situation here?

I’m sorry to bother people with this, but again, due to my blazing stupidity I cannot for the life of me find the documentation on this. Thanks!

Basically it’s number 3. :wink: Everything you reference from a scene is included in the build. That could be a script in the scene that has a reference to a prefab which consits of a mesh / material / … , all those things are included as well.

All stuff in the Resources folders (note the “s”) are always included since unity can’t determine what resources you are going to load.

Also, generally all scripts are included except scripts / assemblies inside an editor folder (or the web template folder, see below).

To get a full list what files are included, see this question(find unused assets)

Some more information on the “special” folders:
All special folders are “relative” folders. That means you can have multiple resources, plugins and editor folders in other subfolders. This allows to group things logically. For example a nodebased shader editor extension can have one root folder in assets and have it’s own subfolder for “editor”, “editor resources” …

Some related links:

http://forum.unity3d.com/threads/97140-About-these-special-folders-in-unity3d-!-Assets-Editor-Resources-Plugins-and-so-on

Unity has added some more special folder meanings in the past. As far as i know there is a web template folder which is ignored by the compiler, since it might contain javascript files (not UnityScript). I can’t find the correct name for this folder at the moment, but i’m sure it exists :wink:

edit
Well i just googled for it :wink: It seems it’s “WebPlayerTemplates”