Search Unity

ProBuilder - "DestroyImmediate" Bug - Experimental (Meshes as Assets)

Discussion in 'World Building' started by DanJa512, Aug 16, 2018.

  1. DanJa512

    DanJa512

    Joined:
    Dec 14, 2015
    Posts:
    18
    This may be a known issue, but I have an editor extension that clears the active scene of created objects. When deleting an asset that has a ProBuilder component on it, I receive in the console an error about calling DestroyObjectImmediate without the boolean flag to allow destruction of assets when using the Meshes as Assets function. Obviously, this is the proper way of destroying scene objects within the editor, but I'm guessing ProBuilder is not including that boolean flag.

    The only reason I personally want to use the Meshes as Assets function is so that I see mesh preview images in prefabs I've made out of ProBuilder objects. I wonder if they're working on getting that to work..
     

    Attached Files:

  2. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    That function should be detecting that the mesh is cached, and instead of Object.DestroyImmediate use AssetDatabase.DeleteAsset. I don't know off-hand why it's not in your case. Can you please file a bug report?