Unity项目是否有标准/推荐的目录结构? [英] Is there a standard/recommended directory structure for Unity projects?

查看:700
本文介绍了Unity项目是否有标准/推荐的目录结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的下一个项目将使用Unity 5.6.这将是一款游戏,它将利用AssetBundle进行远程场景加载.之后将逐步添加新场景.因此,我希望我不会使用结构太差的结构,而该结构在项目的后期阶段需要大量更改. Unity项目是否有标准/推荐的目录结构?

My next project will use Unity 5.6. It will be a game and that will leverage AssetBundle for remote scenes loading. New scenes will be incrementally added afterward. Therefore I hope I won't use a too bad structure that need to be changed a lot in the later stage of the project. Is there a standard/recommended directory structure for Unity projects?

推荐答案

归根结底,归结为最适合您并且对项目最有意义的事情.在处理小型单独项目时,我发现保持一个简单的文件夹结构来分隔资产类型对于将事物(纹理,脚本,预制件,精灵等)保持井井有条非常有效.另一种流行的方法是按对象类型进行组织:

At the end of the day, it comes down to whatever works the best for you and makes the most sense for the project. Working on small solo projects, I've found that keeping a simple folder structure separating asset types has worked well to keep things organized (Textures, Scripts, Prefabs, Sprites, etc). Another popular method is to organize by object type:

Animals
├── Crow
│   ├── script
│   └── sprite
└── Snake
    ├── script
    └── sprite

根据我的经验,按场景进行组织通常效果不佳,尤其是在场景之间共享资产的情况下-东西容易丢失.

In my experience, organizing by Scene has generally not ended up working out well, especially in the case where assets are shared between scenes - stuff tends to get lost.

我建议花一些时间与您的组织打交道,并查看适合您的感觉,尤其是在您的第一个统一项目中.假设您没有在脚本中搜索目录,则在启动后移动文件不会破坏检查器中的关联.

I suggest taking some time to mess around with your organization and see what feels right for you, especially if this is your first unity project. Moving files around after you start will not break associations in the inspector, assuming you are not searching through directories in your scripts.

如果需要更多帮助来决定,请查看下面的一些链接.特别是链接3对此主题进行了很长的讨论.

If you need more help deciding, take a look at some of the links below. Link 3 in particular has a pretty lengthy discussion on this topic.

  • Mastering Unity Project Folder Structure. Level 2 – Assets Organization
  • 50 Tips for Working with Unity (Best Practices)
  • Unity Forums: Best practices - Folder structure

这篇关于Unity项目是否有标准/推荐的目录结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆