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

我们在Unity3D开发的时候,经常会看到它会产生不少固定命名工程文件,诸如:

Assembly-CSharp-vs.csproj 

Assembly-CSharp-firstpass-vs.csproj

Assembly-CSharp-Editor-vs.csproj

Assembly-CSharp-Editor-firstpass-vs.csproj

看得不少人云里雾里的。那么,这些工程是如何产生的呢?各自的作用是什么?下面就来逐一解析。

一. 首先从脚本语言类型来看,Unity3D支持3种脚本语言,都会被编译成CLI的DLL

如果应用中含有C#脚本,那么Unity3D会产生以Assembly-CSharp为前缀的工程,名字中包含"vs的"是产生给Visual Studio使用的,不包含"vs"的是产生给MonoDevelop用的。

应用中包含的脚本语言

工程前缀

工程后缀

C#

Assembly-CSharp

csproj

JavaScript

Assembly-UnityScript

unityproj

Boo

Assembly-Boo

booproj

如果工程中这3中脚本都存在,那么Unity3D将会生成3种前缀类型的工程。

二. 对于每一种脚本语言,根据脚本放置的位置(其实也部分根据了脚本的作用,比如编辑器扩展脚本,就必须放在Editor文件夹下),Unity3D会生成4种后缀的工程。其中的firstPass就表示先编译,Editor表示放在Editor文件夹下的脚本。

下面以C#脚本为例。如果工程中只有C#脚本,不考虑为VS和MonoDevelop各自生成工程的差异性,我们可以得到4个工程文件:

Assembly-CSharp-firstpass-vs.csproj

Assembly-CSharp-Editor-firstpass-vs.csproj

Assembly-CSharp-vs.csproj

Assembly-CSharp-Editor-vs.csproj

(1) 所有在Standard Assets,Pro Standard Assets或者 Plugins文件夹中的脚本会产生一个Assembly-CSharp-firstpass-vs.csproj文件,并且先编译;

(2) 所有在Standard Assets/Editor, Pro Standard Assets/Editor 或这Plugins/Editor文件夹中的脚本产生Assembly-CSharp-Editor-firstpass-vs.csproj工程,接着编译;

(3) 所有在Assets/Editor外面的, 并且不在(1),(2)中的脚本文件(一般这些脚本就是我们自己写的非编辑器扩展的脚本)会产生Assembly-CSharp-vs.csproj工程,被编译;

(4) 所以在Assets/Editor中的脚本产生一个Assembly-CSharp-Editor-vs.csproj工程,被编译。

之所有这样建立工程并按此顺序编译,也是因为DLL间存在的依赖关系所决定的。

好了,至此也说得比较清楚了,也不会因为见到那么多的工程文件而疑惑了。

最后问诸位一个小问题:

一个Unity3D的工程,最多可以产生多少个工程文件?

4*3*2 = 24个

Why is 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, there 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 .csproj and 2 x .sln with 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 is opened automatically by Unity, it has 3 projects with pretty similar structure - every project has an Assets folder, 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 did I get something wrong? Is it possible to reduce the clutter, which makes me unsure which project I should be working on, or are all these files necessary?

The reason I'm asking is there seems to be a lot of redundancy and it's not very clear what each of these projects is responsible for.

 
 

1条回复

  • 排序:

3
最佳解答

个解答,截止stevethorne · 2014年05月02日 13:26

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

If you're wondering why they do this, it's due to the fact that they need to make sure that things get compiled in the correct order. You can take a look at this page for more details on the compile order. That 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 are for the visual studio projects.

【转】全面解析Unity3D自动生成的脚本工程文件的更多相关文章

  1. 【转载】全面解析Unity3D自动生成的脚本工程文件

    我们在Unity3D开发的时候,经常会看到它会产生不少固定命名工程文件,诸如:  Assembly-CSharp-vs.csproj  Assembly-CSharp-firstpass-vs.csp ...

  2. 28nm工艺下,自动生成管脚排列文件,给设计加PAD,并在PAD上面打Label的流程(含Tcl脚本)

    本文转自:自己的微信公众号<数字集成电路设计及EDA教程> 里面主要讲解数字IC前端.后端.DFT.低功耗设计以及验证等相关知识,并且讲解了其中用到的各种EDA工具的教程. 考虑到微信公众 ...

  3. fiddler4自动生成jmeter脚本

    接口.性能测试任务当遇到从浏览器或移动app自己抓包的情况出现时就变得巨苦逼了,苦在哪里?苦在需要通过抓包工具抓报文,需要通过抓包报文梳理业务逻辑.需要将梳理的逻辑编写成脚本.最最苦的情况是,自己抓包 ...

  4. 自动生成项目的Makefile文件

    自动生成项目的Makefile文件 理论基础 跟我一起写 Makefile:   http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=4 ...

  5. Eclipse+Axis自动生成Web Service WSDL文件

    JDK版本:1.5.0_22 Eclipse版本:Helios Service Release 2(3.6.2) 首先创建一个web工程,创建过程如下: 如果选择Apache Tomcat v5.5, ...

  6. 自动生成Mybatis的Mapper文件

    自动生成Mybatis的Mapper文件 工作中使用mybatis时我们需要根据数据表字段创建pojo类.mapper文件以及dao类,并且需要配置它们之间的依赖关系,这样的工作很琐碎和重复,myba ...

  7. 自动生成LR脚本且运行

    背景:作为一个测试,特别是性能测试,尤其在活动的测试,时间紧,有很多要测的,我们的LR11因为浏览器兼容问题全录制不了脚本了,用浏览器加代理或手机加代理录制,我感觉好麻烦 ,所以就想如果能用脚本把所有 ...

  8. Java IDEA根据database以及脚本代码自动生成DO,DAO,SqlMapper文件(一)

    根据数据库代码自动生成的插件挺多的,这里主要分享两种: 1.根据database以及脚本代码自动生成 2.根据mybatis-generator-core自动生成(下一章节进行分享,包含sqlserv ...

  9. Hibernate Tools 自动生成hibernate的hbm文件

    本文有待商榷 当我们在新增插件的时候发现会出现duplicate location,意思是所选的anchive所包含的zip路径已经复用,现象如下: 如上图所示黄色标记部分“Duplicate loc ...

随机推荐

  1. OracleDBConsoleorcl是具体管什么的服务(转)

    这个服务是oracle EM的就是oracle企业管理器这个工具可以通过网页的方式监控数据库,对数据库参数等做修改.里面还有oracle本身对于当前系统内存,SQL,参数等的建议.DBA可以根绝这些建 ...

  2. Codeforces Round #313 (Div. 2) D. Equivalent Strings

    D. Equivalent Strings Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/ ...

  3. jmeter之调度器配置

    Jmeter的线程组设置里有一个调配器设置,用于设置该线程组下脚本执行的开始时间.结束时间.持续时间及启动延迟时间.当需要半夜执行性能测试时会用到这个功能. ps:设置调度器配置,需要将前面的循环次数 ...

  4. DP+BIT(优化复杂度) UESTC 1217 The Battle of Chibi

    题目传送门 题意:问n长度的序列,找出长度m的上升子序列的方案数. 分析:这个问题就是问:dp[i][j] = sum (dp[i-1][k]) (1 <= k <= n, a[k] &l ...

  5. TYVJ P1020 寻找质因数

    做题记录:2016-08-08 描述 给出N个数字,试求质因数最大的数字. 输入格式 第一行,一个整数N,表示数字个数.接下来N行,每行一个整数A_i,表示给出的数字. 输出格式 一个整数,表示质因数 ...

  6. SQL SERVER事务处理

    SQL SERVER事务处理   一.事务定义: 事务是单个的工作单元.如果某一事务成功,则在该事务中进行的所有数据更改均会提交,成为数据库中的永久组成部分. 如果事务遇到错误且必须取消或回滚,则所有 ...

  7. 四、saltstack如何管理对象?

    实验前环境: [root@super65 ~]# salt-key -L[root@super65 ~]# salt-key -a super65.cn -y salt管理对象简介: saltstac ...

  8. [译]- 6-1 排列窗体上的控件(Laying Out Widgets on a Form)

     排列窗体上的控件(Laying Out Widgets on a Form) 中英文对照:form(窗体),layout(布局或者排列,意思是进行窗体上控件的排列的过程,如大小位置等) absolu ...

  9. ThinkPHP框架的部署

    1.将ThinkPHP框架的框架文件放到想要放置的地方,与创建的应用文件夹同级 2.vhost文件中设置虚拟目录 3.在hosts文件中配置 4.在应用目录中创建入口文件index.php 5.在入口 ...

  10. 常用NuGet插件

    1.Install-Package System.Data.SQLite 2.Install-Package FluentData