[unity] Fixed excessive UnloadingUnusedAssetsImmediate during build. Initially created to avoid out of memory exceptions, can now be disabled via preferences. Closes #2160.

This commit is contained in:
Harald Csaszar 2022-09-27 20:38:33 +02:00
parent 965e3c982d
commit eb7bf3a8b3

View File

@ -98,8 +98,8 @@ namespace Spine.Unity.Editor {
#endif #endif
prefabsToRestore.Add(assetPath); prefabsToRestore.Add(assetPath);
} }
EditorUtility.UnloadUnusedAssetsImmediate();
} }
EditorUtility.UnloadUnusedAssetsImmediate();
AssetDatabase.StopAssetEditing(); AssetDatabase.StopAssetEditing();
#if !HAS_SAVE_ASSET_IF_DIRTY #if !HAS_SAVE_ASSET_IF_DIRTY
if (prefabAssets.Length > 0) if (prefabAssets.Length > 0)
@ -147,8 +147,8 @@ namespace Spine.Unity.Editor {
#if HAS_SAVE_ASSET_IF_DIRTY #if HAS_SAVE_ASSET_IF_DIRTY
AssetDatabase.SaveAssetIfDirty(atlasAsset); AssetDatabase.SaveAssetIfDirty(atlasAsset);
#endif #endif
EditorUtility.UnloadUnusedAssetsImmediate();
} }
EditorUtility.UnloadUnusedAssetsImmediate();
AssetDatabase.StopAssetEditing(); AssetDatabase.StopAssetEditing();
#if !HAS_SAVE_ASSET_IF_DIRTY #if !HAS_SAVE_ASSET_IF_DIRTY
if (spriteAtlasAssets.Length > 0) if (spriteAtlasAssets.Length > 0)