Which folders in a Unity project are critical folders?

Dropbox has recently started Selective Sync, which means you can disable certain folders from syncing automatically over the network. Since Unity compiles all assets locally, and since these assets aren't critical (i.e. if you delete them, Unity will just recompile them), I wanted to know something:

Which folders inside a Unity Project heirarchy are non-crucial, meaning, if they are deleted or corrupt or incorrect, Unity will just re-compile them? Here is the typical folder structure I have inside my project folder:

Assets
|- [asset list]
Library
|- cache
|- metadata
|- ScriptAssemblies
obj
|- Debug
Temp
|- bin

So which of these folders, if deleted (or not synced, in this case), would not "break" the project?

As of (at least) Unity 5 Personal (aka the free version), you no longer need to back up anything from the Library folder. Everything in Library can now be safely ignored. The obj and temp directories can be ignored, as before. Project Settings and Assets folders should be checked in. See step #8 at docs.unity3d.

(I have a Recovered Assets folder, but I’m not sure what that’s for. Nothing there has changed in a while, though.)

The only one you need if you have external version control enabled is Assets

Without that, you can get away with Assets, Library/cache and Library/metadata

I use Dropbox for some of my personal projects too, but make sure you are also using version control. I lost a whole project once because Dropbox got all confused during an auto-sync, and destroyed multiple random files within the project. I believe this happened because unity needs to create/adjust a considerable amount of files while you are actively working.

Now, when I work on a unity project that is stored in my Dropbox, I turn off the synchronization by selecting ‘Pause Sync’ while I am working. And when I’m done, I let it resume and catch itself up cleanly. And… I use SVN on top of it all now. :wink:

I’m using the following .gitignore file:

# ---------------[ Unity generated ]------------------ #
**/[Ll]ibrary/*
**/
emp/*
    **/[Oo]bj/*
    **/[Bb]uild/*
    **/[Bb]uilds/*
    **/UnityGenerated/*
    **/Assets/AssetStoreTools*
    
    # ----[ Visual Studio / MonoDevelop generated ]------- #
    ExportedObj/
    .consulo/
    *.csproj
    *.unityproj
    *.sln
    *.suo
    *.tmp
    *.user
    *.userprefs
    *.pidb
    *.pidb.meta
    *.booproj
    *.svd
    
    # Unity3D Crash Reports
    sysinfo.txt
    
    # -------------[ OS generated ]------------------------ #
    .DS_Store
    .DS_Store?
    ._*
    .Spotlight-V100
    .Trashes
    Icon?
    ehthumbs.db
    Thumbs.db
    ios
    ios.app
    
    # include meta files
    !*.*.meta
    
    # Builds
    *.apk
    *.unitypackage