SaveAndReimport()
Save asset importer settings if asset importer is dirty.
Read time 1 minuteLast updated 11 days ago
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(); }}