Unity3d Special folders and script compilation order
Transfer from http://blog.csdn.net/u010019717/article/details/40474631
In most cases, you can select any folder you like in the name of your project, but unity reserves Some names to indicate that the content has a special purpose. Some of these folders can affect the order in which the scripts are compiled. Fundamentally, there are four separate scripts compiled, and the stages of compiling the script are determined by the parent folder.
This is important in cases where the script must reference classes defined in other scripts. The basic rule is that anything after the compilation phase cannot be referenced. Any current phase or earlier stage in the compilation is fully available.
Another scenario occurs when a language script must refer to a class that is defined in another language (for example, a unityscript file that declares a class variable defined in a C # script ). The rule here is that the referenced class must have been compiled at an earlier stage.
The compile phase is as follows:-
Stage 1: Run the Scripts folder called Standard Assets,prostandard Assets and Plugins .
Stage 2: Editor Editor in the script folder called standardassets/editor, Pro standardAssets/editor andplugins/editor.
Stage 3: All other scripts that are not in the Editor folder .
Fourth stage: all the remaining scripts (that is, those that are called Editor Editor ).
Additionally, no script will be compiled in any of the assets folders that are named Webplayertemplates within any of the scripts . This behavior is slightly different, also a special folder name that works within a subfolder (for example,Scripts/editor works as an editor in the script folder but Scripts/webplayertemplates does not block compilation).
A common example is where the Unityscript file needs to reference a class defined in a C # file. You can achieve this by placing the plugins folder inside the C # file and the Unityscript file in a non-special folder . If you do not, you will get the error and say that you cannot find the C # class.
Unity3d Special folders and script compilation order