I am so confused. In this article it’s said that Assets and Library folders are necessary. http://docs.unity3d.com/Manual/BehindtheScenes.html
But other articles said only Assets and ProjectSettings folders are necessary. I am so confused why there are different ideas.
Hi, it looks like you may have found a piece of outdated information in the manual. (EDIT: this page has now been updated). Before we introduced separate “.meta” files which are stored in your Assets folder, this was true - the Library folder used to contain cached data & meta data.
However, in the Current version of Unity, we store the meta information alongside your asset files. The only data stored in the library folder is cached data which can be re-generated from your assets and their accompanying meta files.
The Meta Data stored in the .meta files in your Asset folder is the information and settings specified in the inspector when you examine an asset. Every file in your Asset folder should have a corresponding .meta file. For example, an image file’s meta data would contain the settings for Texture Type, Wrap Mode, Aniso Level, Max size, etc. For a .FBX model file this would be the Scale Factor, mesh compression setting, Rig settings, Animation import settings etc. You can open these .meta files in a text editor and see the settings if you like.
Conversely, the Cached data in the Library folder is the game-ready imported data that has been extracted from your source asset according to the import settings that you specified in the inspector. For example - your source asset may be a PSD file, but graphics hardware can’t use the data in that format, so the image is read & stored in a different format in the Library folder, ready to use as a texture. Similarly, for an FBX file - the model data, materials, animations, etc are all extracted and stored in a game-ready format in the Library folder.
If any of this cached data in the Library folder is missing, it can be re-created by Unity. All it needs are the source asset & the settings in the corresponding .meta file.
This is why, when checking your files into a version control system, you should only include the Assets and ProjectSettings folder.
(I’ll add a note to get that Manual page updated!)
Be careful I found this thread and deleted my libaray folder But Lucky Zipped my project before I deleted the Library folder, (as it was 13 gig the rest of the project was under 5 gigs. )
I got my project back, BUT when I did deleted the Library folder Unity crashed and crashed every time I tried to load the scene this is with Unity 2019.4.13f1 the only way got my project back was Restore the zipped backup…
in theory, Duck may be right sound all solid info ,. but in the real world be careful…
As I understand it, you should be able to delete Library and count on Unity to rebuild it (and ignore it in version control). However, as @thomas4d has pointed out, reality may differ. I recommend backing up your project before deleting Library. If it breaks, restore the Library directory from backup.
Then, you should try to troubleshoot it. Delete a few subdirectories at a time and reload until something breaks, then narrow it down. It’s important to be able to rely on Library functioning as a cache. Otherwise you can’t effectively use version control or cloud build.
That’s what I’m doing next. I’ll try to remember to post my results in a comment below…