Asset metadata
Understand how Unity manages metadata for imported assets.
読み終わるまでの所要時間 3 分最終更新 21日前
As part of the importing process, Unity creates metadata about any assets you import into your project. The metadata contains information such as the asset's import settings, and where your project uses the asset. When you import an asset, Unity does the following:
Asset IDs
The Unity Editor frequently checks the contents of the folder against the list of assets it already knows about. When you place an asset in the folder, Unity detects that you have added a new file and assigns a unique ID to the asset. This is an ID that Unity uses internally to reference the asset, so that it can move or rename the asset without breaking anything. You can use the Import Activity window to view the ID of an asset.
AssetsAssetsMeta files
Unity creates files for each folder and file in your project's folder and stores the file in the same location as the asset file. These files are hidden in the Project window, and are considered a hidden file by your operating system, so might be hidden by default in your file browser.
.metaAssets.metaThe files contain the unique ID assigned to the asset, and values for all the asset's import settings. If you change the import settings for an asset, Unity saves those new settings to the file that accompanies the asset. Unity then re-imports the asset according to your updated settings, and updates the corresponding imported data in the project's folder.
.meta.metaLibraryMoving and renaming assets
Meta files contain important information about how the asset is used in your project, and they must stay with the asset file they relate to. If you move or rename an asset within the Project window, Unity automatically moves or renames the corresponding file. However, if you move or rename an asset outside of Unity, you must move or rename the file to match.
.meta.metaIf an asset loses its file, any reference to that asset is broken in your project. In this situation, Unity generates a new file for the moved or renamed asset as if it's a brand new asset, and deletes the old file. When Unity deletes the old file it might cause significant issues such as the following:
.meta.meta.meta.meta- If a texture asset loses its file, any materials that use that texture lose their reference to that texture. To fix it, you must manually re-assign that texture to any materials which require it.
.meta - If a script asset loses its file, any GameObjects or Prefabs that have that script assigned instead have an unassigned script component, and lose their functionality. To fix it, you must manually re-assign that script to any GameObjects which require it.
.meta
Empty folders and version control
Unity assigns each folder in your project's folder its own file. However, some version control systems (VCS) can't store empty folders. When you add or delete an empty folder from your project, the VCS stores the file as added or removed, but doesn't store the change of adding or removing the folder itself. To help resolve this issue, Unity behaves in the following ways relating to empty folders:
Assets.meta.meta- If Unity detects an empty folder that no longer has a corresponding file, it assumes another user in your VCS deleted the folder and removed the meta file, so deletes the empty folder locally.
.meta - If Unity detects a new file for a folder, but that folder doesn't exist locally, it assumes another user in your VCS created a new folder, and then creates a new unversioned meta file for empty folders.
.meta