# OnWillDeleteAsset(string, RemoveAssetOptions)

> This is called by Unity when it is about to delete an asset from disk.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)

## OnWillDeleteAsset()

```csharp
public void OnWillDeleteAsset(string arg0, RemoveAssetOptions removeAssetOptions)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[RemoveAssetOptions]\(/engine/6000.7/script-reference/unityeditor/removeassetoptions)):&#x20;

### Remarks

If this is implemented, it allows you to delete the asset yourself. Deletion of a file can be prevented by returning [AssetDeleteResult.FailedDelete](/engine/6000.7/script-reference/unityeditor/assetdeleteresult/faileddelete.md) You should not call any Unity AssetDatabase api from within this callback, preferably keep to file operations or VCS apis.
