7 Most Important Things to Keep Your Unity Project Organized

June 9, 2016
protect

This post has originally been published on The Knights of Unity blog (http://blog.theknightsofunity.com/7-ways-keep-unity-project-organized/) by Piotr Korzuszek. More awesome Unity tutorials, tips and tricks on our Blog: http://blog.theknightsofunity.com/

I saw a person on Quora the other day, asking how programmers are able to write projects that consist of over 10 000 lines of code. When software gets bigger, it is more difficult to maintain and that's a fact. So here's the thing - if you won't keep your project organized, you're going to have a hard time to keep the pace. Later on, you will find yourself wasting time with messy project instead of adding new features. This is also true regarding any Unity Project. Here are (in my opinion) most important tips that will help you with keeping your project organized.

1. Directory Structure

We cannot talk about organization without mentioning organizing project directory structure. Unity gives you a total freedom in that matter, but because of that, it can frequently get really messy. This is the directory structure I personally use:

  • 3rd-Party

  • Animations

  • Audio

    • Music

    • SFX

  • Materials

  • Models

  • Plugins

  • Prefabs

  • Resources

  • Textures

  • Sandbox

  • Scenes

    • Levels

    • Other

  • Scripts

    • Editor

  • Shaders

  1. Do not store any asset files in the root directory. Use subdirectories whenever possible.

  2. Do not create any additional directories in the root directory, unless you really need to.

  3. Be consistent with naming. If you decide to use camel case for directory names and low letters for assets, stick to that convention.

  4. Don't try to move context-specific assets to the general directories. For instance, if there are materials generated from the model, don't move them to Materials directory because later you won't know where these come from.

  5. Use 3rd-Party to store assets imported from the Asset Store. They usually have their own structure that shouldn't be altered.

  6. Use Sandbox directory for any experiments you're not entirely sure about. While working on this kind of things, the last thing that you want to care about is a proper organization. Do what you want, then remove it or organize when you're certain that you want to include it in your project. When you're working on a project with other people, create your personal Sandbox subdirectory like: Sandbox/JohnyC.

2. Scene hierarchy structure

Next to the project's hierarchy there's also scene hierarchy. As before, I will present you a template. You can adjust it to your needs.

  • Management

  • GUI

  • Cameras

JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.

Read More>>