About these special folders in unity3d ! Assets Editor Resources Plugins and so on

In unity3d,there are some Special folders, Example,
Assets Resources Plugins Textures Materials Editor Models Prefab Shaders Scripts Sounds Gizmos…

Currently, Ask what I know through some of the information from What are all the special folders and what do they do? - Questions & Answers - Unity Discussions


Resources
The Resources folder is a special folder which allows you to access resources by name in your scripts, rather than by the usual (and recommended) method of direct references. For this reason, caution is advised when using it, because all items you put in the resources are included in your build (even unused assets), because Unity has no way of determining which assets may be used by your project.

Editor
The Editor folder name is a special name which allows your scripts access to the Unity Editor Scripting API. If your script uses any classes or functionality from the UnityEditor namespace, it has to be placed in a folder called Editor (or a subfolder).

Plugins
The “Plugins” folder is where you must put any C, C++ or Objective-C based Plugins which should be included with your project. Plugins are a pro-only feature.

Compilation Order
These special names (and a few others) also determine the compilation order, which is useful to know if you are mixing languages in your project (i.e. using C# and Javascript scripts in the same project), so sometimes you might see the suggestion to put a script in a folder called “plugins” just for this purpose.

As for mixing these folders, eg “Editor/Resources”… I’m not sure - it doesn’t really make a lot of sense to do that. I think it’s generally better to just understand what each special folder’s purpose is and use them individually!

Gizmos
The gizmos folder holds all the texture/icon assets for use with Gizmos.DrawIcon(). Texture assets placed inside this folder can be called by name, and drawn on-screen as a gizmo in the editor.

However, there are no other special folder? For example,“Textures Materials Models Prefab Shaders Scripts Sounds”, they are not specific documents?They have no special function? Do they only facilitate the identification of resources? Hope someone can give more accurate and comprehensive reply, thank you

WebPlayerTemplates
is used to override the default html page used when creating web player builds

StreamingAssets
copied to build folder, accessable via Application.streamingAssetsPath (Unity - Scripting API: Application.streamingAssetsPath)

Standard Assets
compiled similarly to a ‘Plugins’ when it doesnt reside inside of a folder named editor. scripts are output to either Assembly-CSharp-firstpass , Assembly-UnityScript-firstpass, or Assembly-boo-firstpass

I think we’ve listed most of the special folder names in unity. The awkward setup of compile order that is unity only benefits CSharp when .js files are in standard assets or plugins, csharp assemblies seem to always load prior to unityscript ones so if you ever plan on using js classes in csharp code they have to be in plugins or standard assets and the csharp code must be outside of those two special folders. If your using unity script though its somewhat pointless since csharp assemblies are always loaded prior ( i’m pretty sure but it would be good to get confirmation )

Editor folders are compiled last, and you can access js in csharp that way but keep in mind anything in a editor folder doesnt make it out to the final build.
But yea similar to non editor folders the same setup exists, so if the Editor resides in a folder named Standard Assets or Plugins its compiled before the secondary assembly for editor use.

Beyond these folders theres a few other folders specific to mobile platforms. like IOS ( if i remember right ) which lets you place files in that get a symbolic link int he xcode project.

But i don’t doubt that there are other special name folders. would be interested in hearing about them

Thanks for this guys. I’d just like to add a few things.

According to the user docs, any scripts placed in WebPlayerTemplates will not be compiled at all. This can be useful if you want some scripts to be temporarily unavailable while testing.

Pro Standard Assets
Same with Standard Assets only files here are meant for the Pro version

A little more explanation for the Plugins folder:

Plugins
The “Plugins” folder is where you must put any native (C/C++) dlls, which you want to be accessible by your scripts. They will also be included with your build.

Plugins/Android
Place here any Java .jar files you want included in your Android build, used for Java-based plugins. See Unity - Manual: Create and use plug-ins in Android

Plugins/iOS
A limited, simple way to automatically add (as symbolic links) any .a, .m, .mm, .c, or .cpp files into the generated Xcode project. See Unity - Manual: Native plug-ins for iOS

If you need more control how to automatically add files to the Xcode project, you should make use of the PostprocessBuildPlayer feature. Doing so does not require you to place your files in the Plugins/iOS folder. See Unity - Manual: Build Player Pipeline

And yes, most people have folders named Models, Textures, Scripts, etc. simply for organizational purposes, no special properties on those names AFAIK.

Guys, who can advice, if create “Resources/Editor/SomeAsset.asset” will it be included in build?

Yes they will. The editor folder only applies to scripts. Unity - Manual: Special folder names

Oh! Thanks a lot! :slight_smile:

Based on the docs page that @karl_jones posted (version 2021.1 shown below)

Examples:
Assets/Resources/Editor/SomeAsset.asset WILL be included in builds, while
Assets/Editor/Resources/SomeAsset.asset WILL NOT be included in builds.