@@ -476,19 +476,20 @@ void AddSvgImport(string id, string path)
476476
477477 try
478478 {
479- AssetDatabase . StartAssetEditing ( ) ;
479+ AssetDatabase . DisallowAutoRefresh ( ) ;
480480 await Task . WhenAll ( fillsSyncTask , svgToPngSyncTask , svgSyncTask ) ;
481-
482481 await WriteGradientsAsync ( importGradient , requiredImages ) ;
483482 }
484483 finally
485484 {
486- SaveRemaps ( remaps ) ;
485+ AssetDatabase . AllowAutoRefresh ( ) ;
487486 Progress . SetStepLabel ( progress , "" ) ;
488- AssetDatabase . StopAssetEditing ( ) ;
487+ SaveRemaps ( remaps ) ;
489488 }
490489
491- AssetDatabase . ImportAsset ( Path . Combine ( relativeFolder , "Images" ) , ImportAssetOptions . ImportRecursive | ImportAssetOptions . ForceSynchronousImport ) ;
490+ await Awaiters . While ( ( ) => EditorApplication . isUpdating ) ;
491+ AssetDatabase . ImportAsset ( Path . Combine ( relativeFolder , "Images" ) , ImportAssetOptions . ImportRecursive ) ;
492+ await Awaiters . While ( ( ) => EditorApplication . isUpdating ) ;
492493
493494 Progress . SetDescription ( progress , "Importing png..." ) ;
494495 foreach ( TextureImporter importer in importPng . Select ( x => ( TextureImporter ) AssetImporter . GetAtPath ( x ) ) )
@@ -499,7 +500,6 @@ void AddSvgImport(string id, string path)
499500 }
500501
501502 Progress . SetDescription ( progress , "Importing svg..." ) ;
502- #warning These paths are not absolute or relative
503503 foreach ( SVGImporter importer in importSvg . Select ( value => ( SVGImporter ) AssetImporter . GetAtPath ( value . path ) ) )
504504 {
505505#if VECTOR_GRAPHICS_RASTER
@@ -521,7 +521,10 @@ void AddSvgImport(string id, string path)
521521 EditorUtility . SetDirty ( importer ) ;
522522 }
523523
524- AssetDatabase . ImportAsset ( Path . Combine ( relativeFolder , "Images" ) , ImportAssetOptions . ImportRecursive | ImportAssetOptions . ForceSynchronousImport ) ;
524+ await Awaiters . While ( ( ) => EditorApplication . isUpdating ) ;
525+ AssetDatabase . ImportAsset ( Path . Combine ( relativeFolder , "Images" ) , ImportAssetOptions . ImportRecursive ) ;
526+ await Awaiters . While ( ( ) => EditorApplication . isUpdating ) ;
527+
525528 return CleanupAfter ;
526529 }
527530
0 commit comments