I wondering what is inside a Library folder in Unity project?
and my project has Library folder size very big! it’s about 15GB++
so I tried to remove it once, and then when I open my project again,
the Library folder will regenerate a files back, But a size is less than before, (about 4-5GB)
I have to working on many machines, such as Mac, Notebook, PC
and I have to copy it by USB drive to move around,
so if it can regenerate a files back if blank, I can remove it every time I have to move?
Thanks!!!
Library contains cached, preprocessed data for multiple platforms.
Library size will be smaller after you deleted and recreated it, until you start switching to more and more platforms which will add to Library size.
You can safely delete the Library if that makes the file transfer so much faster that it offsets the time needed to regenerate the Library. Which would be a rare case, like a terribly slow USB drive (possibly USB 2.0 or a cheap stick that can’t write more than 10-20 MB/s).
In any case: look into ways to transfer your files without the USB stick. Source control is the way to go. Check out github. Except for the initial up and download, all future file transfers should still be relatively fast because rather than copying tens of gigabytes on an USB stick you may only need to push and pull a couple megabytes over the Internet. You can even set up your own local git repository and sync your devices through (W)LAN.
Yes, it contains your asset database converted to internal format, your packages you added to your project and things like that. It’s a cache basically.
You can remove it, Unity will regenerate it from your imported assets and reimport your packages too.
But you shouldn’t copy your project around manually, use a proper version control system before you hurt your project and it becomes a giant hurdle to fix it.
Just to add to it, if you manually copy are you aware that you MUST NEVER paste the project contents into an already existing project’s folder? The existing version must be deleted first, never “overwritten”.
Otherwise what will happen is that files that you either deleted or renamed in the current version of the project will still be there when you copy the current project into the existing project’s folder on another machine (except maybe OS X - I think it actually does delete existing content first but not 100% sure).
I mention this because you had issues with a growing project size => perhaps this is what made the project so big in the first place?
You don’t need to backup Library folder because it gets recreated. You risk unforeseeable issues by restoring a backup of the Library folder if the project has changed in the meantime.