拿到预制体对应的源头和路径.md 246 B

#unity/日常积累

接口:GetCorrespondingObjectFromOriginalSource()

GameObject rootPrefab = PrefabUtility.GetCorrespondingObjectFromOriginalSource(instance.gameObject);  
string rootPath = AssetDatabase.GetAssetPath(rootPrefab);