Applied same *AssetEditing improvements to the Texture extracting section of TextureExtractor.ExtractTextures() to batch the importing of created Textures.

This commit is contained in:
Gene Tailor 2026-02-16 21:37:44 +00:00
parent dfe2c83a26
commit 2b4ecb5e73

View File

@ -84,9 +84,22 @@ namespace UniGLTF
s_MarkerStartExtractTextures.Begin();
var extractor = new TextureExtractor(data, textureDirectory, subAssets);
foreach (var param in textureDescriptorGenerator.Get().GetEnumerable())
try
{
extractor.Extract(param.SubAssetKey, param);
AssetDatabase.StartAssetEditing();
foreach (var param in textureDescriptorGenerator.Get().GetEnumerable())
{
extractor.Extract(param.SubAssetKey, param);
}
}
catch (Exception e)
{
Debug.LogException(e);
}
finally
{
AssetDatabase.StopAssetEditing();
}
s_MarkerStartExtractTextures.End();