Unity - Scripting API: AssetEditingScope
class in UnityEditor
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
Places the Asset Database into a state that temporarily prevents automatic import, allowing you to group several asset imports together into one larger import.
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 and AssetDatabase.StopAssetEditing 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:
Constructors
| Constructor | Description |
|---|---|
| AssetDatabase.AssetEditingScope | Instantiates AssetEditingScope. Equivalent to calling AssetDatabase.StartAssetEditing(). |
Public Methods
| Method | Description |
|---|---|
| Dispose | Disposes of AssetEditingScope. Equivalent to calling AssetDatabase.StopAssetEditing(). |