Creating new assets from editor scripts has a fixed overhead of ~1s per asset?

So often we find ourselves wanting to create editor scripts for mass processing of assets, and every time we run into this annoyance.

Running AssetDatabase methods for creating/copying/whatever assets always make a relatively big overhead per new asset. If we want to create hundreds of small items(or just empty assets), this piles up.

While editor is processing new assets, mouse will blink into blue circle for 0.5-1s for each asset.

anyone knows a clever workaround for this?

Here there,

My suggestion is to try calling Assetdatabase.StartEditingAssets () before and Assetdatabase. StopEditingAssets () after you are done.

This will process all your imports in bulk instead of one at a time.

Cheers,

The method @BMayne mentioned is StartAssetEditing, see here: Unity - Scripting API: AssetDatabase.StartAssetEditing

It allows you to batch up all your asset imports (e.g: instead of after every new asset is created, it will run for all of them together).

I rolled the dice while on my phone. Thanks @liortal for correcting it :slight_smile:

Thanks guys, much appreciated!