Monday 16 December 2013

Unity Gotcha - What's in a name?

I like my folder structure in any project to be tidy and understandable. 

Cosmetically I find it odd to have folders in folders with the same name.  For example a Materials folder inside another folder called Materials.

I tidied up my folders and used the name 'Resources' to put all my assets in, within that I have Materials, Textures etc.  I thought it sounded like a good name to use.

 


Bad idea!  Folders called 'Resources' have a special meaning in Unity!

Anything in a folder with that name anywhere in the project folder tree will get compiled in to the game build even if the assets within it are never used in the game!

Everything in any other folder name only gets included in the build if it is used somewhere.

Luckily I spotted this before I had gone too far and can move everything to a folder with another name, like 'Content'.

Now I know that some folders have special meanings, I will be more carefull in the future.

No comments: