- Home /
Everything on Resources folder goes to the build?
I just want clarification, my project is aways structured like this:
Resources
->Models
->Prefabs
->Audio
->Etc
Everything is aways under the Resources, but now reviewing the documentation it says:
Resource Folders are collections of assets that are included in the built Unity player, but are not necessarily linked to any GameObject in the Inspector.
So, even if the asset is not used, just being under Resources will make it in to the build?
I would think so, as the idea is that stuff in Resources isn't necessarily loaded at startup. So it may or may not ever get loaded. I'm not sure it bundles in all file types though? Even so I think it would because you might have your own parser.
Answer by Karsnen_2 · Jan 15, 2013 at 08:55 PM
Resources are always included, so if you're trying to save space in output, you will HAVE to move them out of a Resources directory.
But if you happen to tag your GameObject as "EditorOnly", it will not be included along with its non-Resource dependencies.
The other way which may or may not be able to exclude files (I don't think you can), is to write your own Debug class. You can stop it from working outside Unity by using a check:
if(Application.isEditor)
Just use that condition everywhere in your class to stop it from running outside of the editor, on client machines.
Hope this helps
SOURCE : http://answers.unity3d.com/questions/23761/can-i-exclude-specific-assets-in-assetsresources-f.html
I wish this was true. Unity keeps excluding some of my files in build. Still trying to figure out what is the problem.
Note that files in the Resources folder are of course only included if they are actual asset types that are recognised by Unity. It's all about the AssetDatabase. If you put unsupported file types in that folder they are of course ignored. If you want to include raw files you should use the Strea$$anonymous$$gAssets folder. Unity doesn't care about what type of files you put in there. They are just copied verbatim / as they are when you build your game. However some platforms like Android are a special case since the files are packed into the APK file and can only be accessed through a UnityWebRequest with a special URI.
Anyways if you have an actual question, please ask a seperate question.
Well, thanks, but I said I'm trying to figure out, I did not ask :) $$anonymous$$y point was the answer here is a bit misleading cause it says "Resources are always included". That is not the case, as you've just confirmed.