Special folder and script compilation Sequence

Source: Internet
Author: User
Zookeeper

Special folder and script compilation Sequence

In most cases, you can select the name of any folder you like in your project, but unity reserves some names to indicate that the content has a special purpose. Some of these folders affect the script compilation sequence. Basically, there are four separate scripts to compile. The script compilation stage is determined by the parent folder.

In this case, the script must reference the classes defined in other scripts. The basic rule is that nothing after the compilation phase cannot be referenced. The current or earlier stages in any compilation are fully available.

In another case, a language script must be written to a class defined in another language (for example, the unityscript file that declares the class variables defined in the C # script. The rule here is that the referenced class must have been compiled earlier.

The compilation phase is as follows :-

Stage 1:In the running script folderStandard assets,Prostandard assetsAndPlugins.

Stage 1:In the editor script folderStandardassets/Editor,Pro standard assets/EditorAndPlugins/Editor.

Stage 1:NoEditorAll other scripts in the folder.

Stage 4:All the remaining scripts (that is, those calledEditorFolder ).

In addition, a name namedWebplayertemplates. This behavior is slightly different, and the name of the special folder that also works in the subfolders (for example, scripts/Editor works as the editor script folder, but scripts/webplayertemplates does not block compilation ).

A common example is that the unityscript file must reference a class defined in the C # file. You can achieve this by placing the C # file in a non-special folder in the plugins folder and the unityscript file. If you do not do this, you will get an error and say you cannot find the C # class.

Special folder and script compilation Sequence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.