Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Feedback AssetModificationProcessor.OnWillDeleteAsset behaviour change

Discussion in 'Editor & General Support' started by HarryCodder, Feb 10, 2021.

  1. HarryCodder

    HarryCodder

    Joined:
    Feb 20, 2015
    Posts:
    82
    Hello everyone,

    Between Unity 2019.1 and 2019.4, the behaviour of AssetModificationProcessor.OnWillDeleteAsset has changed when returning AssetDeleteResult.FailedDelete.

    Before, nothing happened or a log was maybe displayed notifying the "failure".
    Now, a dialog box is shown with the message "Some assets could not be deleted. Make sure nothing is keeping a hook on them, like a loaded DLL for example".

    I think this change is ill advised and that the dialog box should only be shown if the Unity internal code is the one failing to delete the asset.
    If an implementation of AssetModificationProcessor.OnWillDeleteAsset returns AssetDeleteResult.FailedDelete, it should be its responsibility to display a dialog box if necessary.
    In my case, I want to return AssetDeleteResult.FailedDelete to prevent the deletion of assets in some cases. Thus I display a dialog box notifying the user that the asset cannot be deleted at this time. And then the new dialog box shows up giving a completely irrelevant message.

    I filed a bug report about that but was redirected to the forums.
    I hope a Unity developer will see this then.

    Thanks in advance.