Does Unity pack all files from the project in the build?

It’s probably a stupid question, but I’m just wondering.

Let’s say you have 100 files in your Unity project, but your game only uses 50 of those files.
So when you build the game, will Unity include all 100 files (used and unused) in the game build, or just the 50 that you used?

  • If they’re referenced by an object instantiated in a scene anywhere, they’ll be included.
  • If they’re placed in the /resources folder, they’ll be included.
  • If they’re an “orphan” - placed in the assets directory but not referenced by anything or used anywhere, they won’t be included in a build.

No, unity tries to be smart about it and pack the least amount of files.
There are some exceptions though.

All files in resources and streamingassets folders will be included.
Files from the Editor folders will not be included.
All other files won’t be included when they’re not used.