Multible&Nested Resources Folders

As i found out one can have multiple Folders in your project called “Resources” to use them with “Resources.Load”. Connected with this it seems to be not a requirement for the “Resources” folder do sit in the root.

Unity is so clever to find them:

A)if the “Resources” folder(s) is(are) in some sub/sub folder
B) if there are multiple “Resources” folders in different subdirectories. This is great if you base some localization scheme on “Resources.Load”. This way you can maintain a clean structure without having all resources sit in the same folder.

Is this officially supported or does this all just work by coincidence ?
Could some unity tech give some insight here ?

The resources folder, which must be at the top level of the Assets folder, is the only place you can store resources to be loaded at runtime. You can have other sub-folders elsewhere called “Resources”, but Unity won’t be able to find them with Resources.Load. You can have as many sub-folders as you like within the top level Resources folder, though, so you can organise your project as you like.

The Resources class also has a method called LoadAssetAtPath which can find any asset in any folder from a path, but it only works in editor scripts (ie, you can’t find resources in this way during gameplay).

This is now incorrect. I’ve been loading non top level resources at runtime for quite a while now.

7 Likes