I’m sure there’s a Special folder name,
that simply tells Unity to ignore it, ie, you can sit scripts in there for convenience that are simply not compiled, ignored by Unity.
Does someone remember the name of this special folder?
PS it’s so silly they don’t have a page in the doco: “absolute list of special folder names.”
Start the folder name with a dot “.”.
Unity ignores folders (and files) starting with “.” (e.g. .svn, .git…).
There’s no dedicated folder for this purpose. We wanted such a folder for a long time.
WebPlayerTemplates trick does not work any more since web player is discontinued. Instead, scripts placed in StreamingAssets folder are not compiled, but it seems they will be included in the build as text assets if you leave them there.
For me better solution was to add a “~” to the end of the folder name like on the docs:
- not compiling on Editor
- not included on Builds
- not be visible inside Unity Editor project tab
- not be hidden on Windows or Linux
- have as many folders as you want, starting with the alphabetical order you want
But if I need that folder to be under Unity’s built-in version control, I need to put inside:
It’ll continue to work with the 5 points mentioned before, except that will be visible on editor project tab, at least on Unity 2019.3.x
There is another way.
After 9 years, we can now use Assembly Deffinition files.
In the folder that you do not want to compile, right-click to create an Assembly Definition file, open the Inspector, check the “AnyPlatform” checkbox, and turn on all the “ExcludePlatform” checkboxes.
This will prevent all the .cs files in the folder/sub folders from being compiled recursively on all platforms. (including Editor).