The library folder is a large cache containing imported assets and other data from the project after import. It is generally always 100% safe to delete the Library folder. As Unity has become more stable, this has become much less necessary than it once was. It is also possible to remove some subfolders without requiring to delete the entire Library folder and have it re-import/re-compile everything.xssss
|Contains project dependency graph
|All the imported assets
|Files compiled in the editor using Burst
|Files from il2cpp build
|Downloaded packages, it is possible for these to be corrupted
|Data from player builds
|All compiled and referenced assemblies
|Cached compiled shaders
|State of the Editor
|Artifact DB of everything in Artifacts folder
|Deleting this will invalidate Artifacts folder
|Artifact DB lock file
|Binary build report from last build
|Log files from shader compilers
|The source Asset Database contains meta-information about your source asset files which Unity uses to determine whether the file has been modified, and therefore whether it should reimport the files. This includes information such as last modified date, a hash of the file’s contents, GUIDs and other meta-information.
|SourceAsset DB lock file
Unity provides this tool in
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\Tools which allows you to inspect data in the Library folder.
(AssetDatabase v1. See Artifacts for AssetDatabase v2.)
Contains the serialized, imported data keyed by an asset's GUID.
binary2text.exe can be used to dump and view the cached imported data.1)
(AssetDatabase v2. See metadata for AssetDatabase v1.)
During import of an asset, the asset importer is run, which produces some number of Unity serializable assets.
This folder is also related to the
The Artifacts folder stores these post-import generated files for every asset, keyed by the hash of the generated asset.2) These generated assets are also called
producedFiles in Unity internal.
You can look up a disk Asset's post-import representation by 3):
binary2text.exe can be used to dump and view the post-import asset data in this folder.4)
You can query the path of an artifact using
AssetDatabaseExperimental5). An artifact may have an ArtifactPath that looks like:
VirtualArtifacts/Primary/f1a775a1988b4d6418f6ccb2522b70a3, rather than having a disk path. I can only assume that these “VirtualArtifacts” are stored somewhere in memory, for efficiency, rather than stored on disk.