# AssetDatabase.AssetEditingScope

> Places the Asset Database into a state that temporarily prevents automatic import, allowing you to group several asset imports together into one larger import.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class AssetDatabase.AssetEditingScope : IDisposable
```

## Remarks

This class allows you to pause the Asset Database's automatic import of new or modified assets. This is useful if you want to perform actions via script that make multiple changes to assets without the Asset Database importing each change in a separate import process.

Instead, you can pause imports, make multiple changes, then resume imports, which means Unity will only perform one input process for all the changes you made while the importing was paused.

This class is an alternative to the [AssetDatabase.StartAssetEditing](/engine/6000.5/script-reference/unityeditor/assetdatabase/startassetediting.md) and [AssetDatabase.StopAssetEditing](/engine/6000.5/script-reference/unityeditor/assetdatabase/stopassetediting.md) methods, which serve the same purpose.

The `AssetEditingScope` class is intended to be used within a `using` statement, which automatically disposes of the class, as in the following example:

```csharp
using UnityEngine;
using UnityEditor;

public class AssetEditingScopeExample : MonoBehaviour
{
    [MenuItem("APIExamples/AssetEditingScope")]
    static void CallAssetDatabaseAPIsBetweenAssetEditingScope()
    {
        // Place the Asset Database in a state where
        // importing is suspended for most APIs
        using (var editingScope = new AssetDatabase.AssetEditingScope())
        {
            // Modify the assets however we like
            AssetDatabase.CopyAsset("Assets/CopyAsset.txt", "Assets/Text/CopyAsset.txt");
            AssetDatabase.MoveAsset("Assets/MoveAsset.txt", "Assets/Text/MoveAsset.txt");
        }
        // Assets will now be imported again, as editingScope has been disposed.
    }
}
```

If you use it in a different context other than a `using` statement, you must ensure that its `Dispose()` method is called or the Asset Database will remain in a paused state.

Additional Resources: [AssetDatabase.StartAssetEditing](/engine/6000.5/script-reference/unityeditor/assetdatabase/startassetediting.md), [AssetDatabase.StopAssetEditing](/engine/6000.5/script-reference/unityeditor/assetdatabase/stopassetediting.md).

## Constructors

| Constructor                                                                                                | Description                                                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AssetEditingScope()](/engine/6000.5/script-reference/unityeditor/assetdatabase/asseteditingscope/ctor.md) | Instantiates AssetEditingScope. Equivalent to calling [AssetDatabase.StartAssetEditing](/engine/6000.5/script-reference/unityeditor/assetdatabase/startassetediting.md)(). |

## Methods

| Method                                                                                            | Description                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Dispose](/engine/6000.5/script-reference/unityeditor/assetdatabase/asseteditingscope/dispose.md) | Disposes of AssetEditingScope. Equivalent to calling [AssetDatabase.StopAssetEditing](/engine/6000.5/script-reference/unityeditor/assetdatabase/stopassetediting.md)(). |
