CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
|
|
static |
Scans for external file system modifications and updates the Database accordingly. Prefer to use CodeSmileEditor.Asset.File.Import within CodeSmileEditor.Asset.File.BatchEditing. CAUTION: ImportAll ('Refresh') unloads unused resources. This can degrade editor performance!
For best performance, prefer to use CodeSmileEditor.Asset.File.Import(String[],ImportAssetOptions) to import multiple assets in a batch operation.
When to call ImportAll (same as AssetDatabase.Refresh):
Modified means the following:
History: I believe there was a time around Unity 3.x-ish where the Editor did not have an "auto refresh" feature, so calling 'AssetDatabase.Refresh' after any AssetDatabase operation was common. This seems to have stuck, even though it is no longer required. 'Refresh' remains over-used with no thought given to its necessity or performance implications.
Any file operation done VIA the AssetDatabase these days does not require an AssetDatabase refresh! Only file operations that bypass the AssetDatabase require importing affected files. In most cases you know which files are affects, so import them individually. Everyone will thank you for the effort!
CAUTION: Since this method unloads 'unused' assets, any unloaded asset will have to be reloaded when accessed again. Worst case scenario: An editor script that indiscriminately calls this method after common editor operations, such as selection change events, can severely degrade Editor performance!
Further reading for the curious: AssetDatabase Refreshing
options | ImportAssetOptions |