当前位置:网站首页>Unity Detailed explanation of meta file function

Unity Detailed explanation of meta file function

2022-06-21 08:21:00 kuilaurence

If you use something like SVN Version control tools , Then you have to understand Meta Role of documents .

Reference a game resource in the game scene ,Unity Not directly according to the file path and name , Instead, use a unique GUID To point to the resource file in the project . This GUID Stored in the Unity The project generates for each resource and folder Meta In the document .

Use GUID Is that , Even if you move 、 Rename or modify the content of the resource , This resource can still be accessed through GUID To be quoted ( as long as GUID unchanged , Resources can be referenced ).

The disadvantage is that you must be clearly aware of Meta Files are associated with specific resources , If you delete one meta file ,Unity It will be considered that the original resource file has been deleted , And then for this “ new ” The resource file generates a new GUID. This is the most common reason for the interruption of resource references in game scenes .

except GUID,meta The file also stores information about resource import . for example , Map assets can be imported as standard maps 、 Normal map 、GUI Mapping 、cookie Or ray mapping . These import settings are stored in meta In the document .

There was a problem before , I uploaded it to SVN The monster of Prefab, Check on the planning side to see if “Missing Script” The problem of , After inspection , Is the of the missing script meta The file was not uploaded to SVN. therefore , According to the above theory , thus Prefab Could not find a reference to the script .

原网站

版权声明
本文为[kuilaurence]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206210819215127.html