Structure of Unity project

Often new projects started as “proof of concept” from scratch, as thrown assets from assetstore here and there, with custom code placed between downloaded assets, random created scenes, prefabs, images and sounds. When project moves to more mature stage - it’s already uncontrolled dump and no one knows what can be removed and what not. Familiar situation?

Often new projects started as “proof of concept” from scratch, as thrown assets from assetstore here and there, with custom code placed between downloaded assets, random created scenes, prefabs, images and sounds. When project moves to more mature stage - it’s already uncontrolled dump and no one knows what can be removed and what not. Familiar situation?

If you don’t want to have pain later, you should care about assets hierarchy from project start and to the end. All teammates should follows same rules without exceptions. I can suggest next hierarchy:

  • Assets // Root folder of each Unity project, all custom assets should be placed inside.
    • LeopotamGroup.Ecs - 3d-party asset.
    • Client - All assets which was created for this project.
      • Animations
        • Controllers - AnimationController graphs / masks for them.
        • Sources - Source animations in FBX / DAE formats.
      • Fonts - Fonts.
      • Images - 2d images not dependent on 3d content.
        • AppIcon - Application icons for all platforms.
        • Ui - All things relative to in-game UI.
          • Atlases - UI-atlases.
          • Sources - Sources for building UI-atlases. Each atlas - separate folder with same name as UI-atlas.
      • Models - 3d content, internal hierarchy dependent on project.
      • Prefabs - Prefabs, internal hierarchy dependent on project.
      • Resources - Internal hierarchy dependent on project. Keep data low as possible!
      • Scenes - Scenes, internal hierarchy dependent on project.
      • Scripts - Source code, internal hierarchy dependent on project.
      • Shaders - Shaders, internal hierarchy dependent on project.
      • Sounds - Audio content, internal hierarchy dependent on project.
      • StreamingAssets - Data for streaming, optional folder.
    • Plugins - Platform-dependent assets.
    • StandardAssets - 3d-padrty asset.

You can find that all project specific assets placed in separate folder with name “Client”. It allows us to keep 3d-party assets from mixing with our custom assets and update external assets from asset store without pain.

Why folder named “Client”? Name can be any, I use this word for unification (because I’m lazy). Using one name allows to reuse assets from one project in another, even source code (namespaces will be same).

Why Keep data low as possible! inside folder “Resources”? Any folder with name “Resources” will be recognized by Unity as special folder and all content inside will be packed to release build even if it not used anywhere inside project.

If you need some fast tests for something - better to create new folder “_TEMP” at root “Assets” folder. Don’t forget - it’s only for temporary tests, should be removed right after end of test!

If you will keep your project clean and in organized manner from scratch - it will save you huge amount of time for garbage clearing before game will be published.