Unity — Project Structure Best Practices!

Unity3D is a powerful suite of tools (Project IDE, Code IDE, and run-time) for game development. Unity supports several languages, but the community consensus is to use only C#.

I am a Unity Game & Tools Developer with over 20 years of game development experience. I am available for hire (Remote, Contract).

SamuelAsherRivello.com

Pros of Project Structure

Regardless of which convention you choose to use for Unity or other platforms, having a solid project structure is considered a good idea by the majority of the development community.

Having good coding standards and an established project structure is beneficial to your project and your team.

See my Coding Standards for C#.

A hallmark of Getting Things Done efficiently is to automate what can be automated. Once a team has standards and project structure and adopts them (both admittedly time consuming) the time improvements in the daily workflow are notable. There is less discussion on why or how to name things. It just gets done.

  • Consistency — The project structure has consistency in presentation regardless of team location, spoken language, or individual programmers.
  • Maintenance — Consistent project structure will aid readability. Readability helps new and existing programmers revisit the code base for fixes and improvements.
  • Communication — Developers more implicitly understand each other in written and verbal communication.

Root Folder Structure

MyProject
├── Assets
├── Packages
└── ProjectSettings

Assets Folder Structure

Assets
├── 3rdParty
│ ├── [VendorName]
│ ├── readme.txt (Manually created. Source URL & changelog)
│ └── [PackageName]
├── Art
│ ├── Animators
│ ├── AnimationClips
│ ├── Fonts
│ ├── Materials
│ ├── Models
│ ├── Shaders
│ ├── Sprites
│ └── Textures
├── Audio
│ ├── AudioClips
│ └── AudioMixers
├── Documentation
├── PhysicMaterials
├── Prefabs
│ └── RMC
│ └── [MyProject]
│ └── MyHeroPrefab (using MyHero.cs)
├── Presets
├── Resources
├── Scenes
├── ScriptableObjects
│ └── RMC
│ └── [MyProject]
│ └── MyHeroSettings (using MyHeroSettings.cs)
└── Scripts
├── Editor
│ └── RMC
│ └── [MyProject]
│ └── MyHeroEditor.cs (namespace RMC.MyProject)
├── Runtime
│ └── RMC
│ └── [MyProject]
│ └── MyHero.cs (namespace RMC.MyProject)
└── Tests
└── Editor
└── RMC
└── [MyProject]
└── MyHeroTest.cs (namespace RMC.MyProject)
  • RMC represents my custom company name
  • MyProject represents the custom project name.
  • Art consolidates common creative concerns. For the creative team, this consolidation facilitates onboarding, committing, and policing commits.

Unity Game & Tools Developer. 20 years of game development experience. Available: Remote, Contract. http://www.SamuelAsherRivello.com