File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -76,20 +76,22 @@ private static IEnumerable<SerializedObject> GetSerializedObjectsFromPrefabs()
76
76
77
77
foreach ( var prefabGUID in prefabGUIDs )
78
78
{
79
- string prefabPath = AssetDatabase . AssetPathToGUID ( prefabGUID ) ;
79
+ string prefabPath = AssetDatabase . GUIDToAssetPath ( prefabGUID ) ;
80
80
81
81
if ( string . IsNullOrEmpty ( prefabPath ) )
82
82
continue ;
83
-
83
+
84
84
var rootGameObject = PrefabUtility . LoadPrefabContents ( prefabPath ) ;
85
-
85
+
86
86
if ( rootGameObject == null )
87
87
continue ;
88
88
89
89
foreach ( var serializedObject in GetSerializedObjectsFromGameObject ( rootGameObject ) )
90
90
{
91
91
yield return serializedObject ;
92
92
}
93
+
94
+ PrefabUtility . UnloadPrefabContents ( rootGameObject ) ;
93
95
}
94
96
}
95
97
@@ -107,6 +109,7 @@ private static IEnumerable<SerializedObject> GetSerializedObjectsFromScriptableO
107
109
continue ;
108
110
109
111
yield return new SerializedObject ( scriptableObject ) ;
112
+ Resources . UnloadAsset ( scriptableObject ) ;
110
113
}
111
114
}
112
115
}
You can’t perform that action at this time.
0 commit comments