"Go" to fully parse Unity3d automatically generated script project files

Source: Internet
Author: User

http://blog.csdn.net/jjiss318/article/details/7632041

When we develop in Unity3d, we often see that it produces many fixed-name engineering files, such as:

Assembly-csharp-vs.csproj

Assembly-csharp-firstpass-vs.csproj

Assembly-csharp-editor-vs.csproj

Assembly-csharp-editor-firstpass-vs.csproj

See a lot of people foggy. So, how did these projects arise? What are the respective roles? Here's how to parse each.

I. First, from the scripting language type, Unity3d supports 3 scripting languages and will be compiled into the CLI DLLs.

If the application contains C # scripts, then Unity3d will produce a project prefixed with Assembly-csharp, with the name "vs" being generated for use by Visual Studio and not containing "vs" for MonoDevelop.

Scripting languages included in the app

Project Prefix

Project suffix

C#

Assembly-csharp

Csproj

Javascript

Assembly-unityscript

Unityproj

Boo

Assembly-boo

Booproj


If the 3 scripts are present in the project, then Unity3d will generate 3 types of prefix-type projects.

Two. For each scripting language, depending on where the script is placed (in part, depending on the script, such as the editor extension script, must be placed in the Editor folder), Unity3d will generate 4 suffixes of the project. The Firstpass is compiled first, and editor represents the script placed under the Editor folder.

The following is an example of a C # script. If there are only C # scripts in the project, and do not consider the difference between the different projects generated for VS and MonoDevelop, we can get 4 project files:

Assembly-csharp-firstpass-vs.csproj

Assembly-csharp-editor-firstpass-vs.csproj

Assembly-csharp-vs.csproj

Assembly-csharp-editor-vs.csproj

(1) All scripts in standard Assets,pro standard Assets or plugins folder will produce a assembly-csharp-firstpass-vs.csproj file and compile it first;

(2) All in standard Assets/editor, Pro standard assets/editor or this plugins/ The script in the Editor folder produces the Assembly-csharp-editor-firstpass-vs.csproj project, which is then compiled;

(3) All the script files outside the Assets/editor and not in (1), (2) (typically these scripts are scripts that we write ourselves as non-editor extensions) will produce assembly-csharp-vs.csproj works and be compiled;

(4) So the script in Assets/editor produces a assembly-csharp-editor-vs.csproj project, which is compiled.

All of this builds and compiles in this order, as determined by the dependencies that exist between DLLs.

Well, this has also been more clear, and will not see so many engineering documents and doubts.

Finally ask you a small question:

How many engineering documents can be produced for a Unity3d project?

4*3*2 = 24 x

Why are the Unity folder so cluttered with IDE files

Whenever I create a new Unity project, add a C# script file and synchronize it with an external source code editor, the Re appears a number of .sln and .csproj files generated in the main project folder.

I wouldn ' t bother it wasn ' t for the fact that there's 6 x and .csproj 2 x with .sln names like:

    • Assembly-csharp.csproj

    • Assembly-csharp-editor.csproj

    • Assembly-csharp-editor-vs.csproj

    • Assembly-csharp-firstpass.csproj

    • Assembly-csharp-firstpass-vs.csproj

    • Assembly-csharp-vs.csproj

After a solution was opened automatically by Unity, it had 3 projects with pretty similar structure-every project have an Assetsfolder, but seems to include a different permutation of assets.

Whether I use VS or MonoDevelop doesn ' t matter. The question is:

Is this a standard project structure or do I get something wrong? Is it possible to reduce the clutter, which makes me unsure which project I should being working on, or was all these files n Ecessary?

The reason I ' m asking is there seems to being a lot of redundancy and it's not very clear, all of these projects is RESP Onsible for.

Comments 1Reply
    • Sort:
3Best Answers

answer , as of Stevethorne • May 02, 2014 13:26

This is the standard solution structure for a Unity project. Each one can has a number of projects in the solution. Mine usually has 6 projects in the solution. You didn ' t do anything wrong, and there's nothing for you can does to reduce this. These is needed for both unity and the IDE, that's the You ' re using.

If you ' re wondering why they does this, it's due to the fact that they need to make sure that things get compiled in the COR Rect order. You can take a look at this page for more details on the compile order. That's might also help you understand what's put in each project.

For those not wanting to go searching for what ' s in each project, here's a basic synopsis:

Assembly-csharp-firstpass.csproj

    • Contains the files in the Standardassets folder.

Assembly-csharp.csproj

    • Contains the files outside of the Editor folder.

Assembly-csharp-editor.csproj

    • Contains the files inside of the Editor folder.

The projects that replace "CSharp" with "Unityscript" contain the Unity Script files in the same manner.

As for the ones ending In-vs, I ' d imagine those is for the Visual Studio projects.

"Go" to fully parse Unity3d automatically generated script project files

Related Article

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.