Search Unity

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

Discussion in 'Immediate Mode GUI (IMGUI)' started by SirIntruder, Sep 3, 2015.

  1. SirIntruder

    SirIntruder

    Joined:
    Aug 16, 2013
    Posts:
    49
    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?
     
  2. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    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,
     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
  4. BMayne

    BMayne

    Joined:
    Aug 4, 2014
    Posts:
    186
    I rolled the dice while on my phone. Thanks @liortal for correcting it :)
     
  5. SirIntruder

    SirIntruder

    Joined:
    Aug 16, 2013
    Posts:
    49
    Thanks guys, much appreciated!