Version: 2022.1

AssetDatabase.SaveAssetIfDirty

切换到手册
public static void SaveAssetIfDirty (Object obj);
public static void SaveAssetIfDirty (GUID guid);

参数

obj The asset object to be saved, if dirty.
guid The guid of the asset to be saved, if dirty.

描述

Writes all unsaved changes to the specified asset to disk.

This function is similar to SaveAssets, and likewise should not be called during serialization.

It does not invoke AssetModificationProcessor.OnWillSaveAssets, as the asset is directly specified.