Search Unity

Folder organization

Discussion in 'General Discussion' started by JoelVDV, May 20, 2014.

  1. JoelVDV

    JoelVDV

    Joined:
    Oct 26, 2013
    Posts:
    11
    Greetings!

    I've come across two different approaches to organizing assets.

    The first is to have folders first separating assets into their types, and then into various 'topics'.
    The other, is that in reverse: 'topics' are separated, and then asset types.

    For example:

    Type 1:
    Materials/Terrain/blah
    Scripts/Combat/HealthBar.cs
    Scripts/Combat/etc.
    Scripts/WorldGeneration/PerlinNoise.cs
    Textures/Combat/HealthBar.png

    Type 2:
    Combat/Scripts/HealthBar.cs
    Combat/Scripts/etc.
    Combat/Textures/HealthBar.cs
    Terrain/Materials/blah
    WorldGeneration/Scripts/PerlinNoise.cs



    Do you follow one of these methods? Or do you have a completely different approach? I quite interested in hearing how others take on the task of managing their assets.
     
  2. amit1532

    amit1532

    Joined:
    Jul 19, 2010
    Posts:
    305
    its a tricky one...
    sometimes type 1 doesnt really work well,
    if you have a model, you want to have all of its assets in one place, you dont want to find all of them in seperate places. they all are related to one thing.

    but, for scripts, i use type 1 because If i want to access a script, i know i will find it inside Scripts folder.
    using type 2, there is no way of knowing if a folder called "Items" has a script in it..

    so there are some exceptions to the rule, id be using both, but will plan on how to decide where to put each asset before i begin working.
     
  3. Errorsatz

    Errorsatz

    Joined:
    Aug 8, 2012
    Posts:
    555
    It's an interesting question, they both have their advantages.

    Currently, I use Type 1, because I've found that I more often need to perform an operation on all assets of a given type than all assets from a given section of the game. Not to mention that some assets are going to span across multiple parts of the game anyway.
     
  4. swyrazik

    swyrazik

    Joined:
    Apr 21, 2013
    Posts:
    50
    I use Type 1. Most of the times I find myself looking for "that script" or for "that texture" rather than for "that enemy" or for "that object". I'm probably following the flow of how I think, for example "I need to find the script of the player that..." => Script -> Player => Script/Player/MyScript.cs.

    This way might also be better when working in a team, so artists will just have to deal with the Textures folder, while programmers with the Scripts folder. If you are working solo, then it's probably about personal preference.
     
  5. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Where do you guys store prefabs? Do you have a separate folder for prefabs on the same level as scripts/materials/models?