Special folder and script compilation order of Unity3d Technology

Source: Internet
Author: User

Welcome to Unity Learning, unity training, Unity Enterprise training and education zone, there are many u3d resources, u3d training videos, u3d tutorials, U3d Frequently asked questions, U3d Project source code, we are committed to creating the industry Unity3d training, learning the first brand.

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:-

1th stage: Run the Scripts folder called Standard Assets,prostandard Assets and plugins.

2nd stage: Editor Editor in the script folder called Standardassets/editor,pro Standard Assets/editor andplugins/editor.

3rd stage: All other scripts that are not in the editor folder.

Stage four: All the remaining scripts (that is, those that are referred to as editor editors).

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.

For more highlights, please click http://www.gopedu.com/

Special folder and script compilation order of Unity3d Technology

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.