SaveAndReimport()
Save asset importer settings if asset importer is dirty.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public void SaveAndReimport()
Remarks
Under the hood this calls AssetDatabase.ImportAsset. Additional Resources: EditorUtility.SetDirty.
Examples
using UnityEngine;using UnityEditor;public class SaveAndReinportExample : MonoBehaviour{ [MenuItem("Tools/SaveAndReimportExample")] static void Example() { var importer = AssetImporter.GetAtPath("Path/To/Your/Asset"); //Setting asset as dirty to mark it for reimport EditorUtility.SetDirty(importer); //Save and reimport to apply changes importer.SaveAndReimport(); }}