internal static void SaveUnappliedTextureImporterSettings() { InspectorWindow[] allInspectorWindows = InspectorWindow.GetAllInspectorWindows(); for (int i = 0; i < allInspectorWindows.Length; i++) { InspectorWindow inspectorWindow = allInspectorWindows[i]; ActiveEditorTracker tracker = inspectorWindow.tracker; Editor[] activeEditors = tracker.activeEditors; for (int j = 0; j < activeEditors.Length; j++) { Editor editor = activeEditors[j]; TextureImporterInspector textureImporterInspector = editor as TextureImporterInspector; if (!(textureImporterInspector == null)) { if (textureImporterInspector.HasModified()) { TextureImporter textureImporter = textureImporterInspector.target as TextureImporter; if (EditorUtility.DisplayDialog("Unapplied import settings", "Unapplied import settings for '" + textureImporter.assetPath + "'", "Apply", "Revert")) { textureImporterInspector.ApplyAndImport(); } } } } } }
internal static void SaveUnappliedTextureImporterSettings() { foreach (InspectorWindow allInspectorWindow in InspectorWindow.GetAllInspectorWindows()) { foreach (Editor activeEditor in allInspectorWindow.GetTracker().activeEditors) { TextureImporterInspector importerInspector = activeEditor as TextureImporterInspector; if (!((UnityEngine.Object)importerInspector == (UnityEngine.Object)null) && importerInspector.HasModified() && EditorUtility.DisplayDialog("Unapplied import settings", "Unapplied import settings for '" + (importerInspector.target as TextureImporter).assetPath + "'", "Apply", "Revert")) { importerInspector.ApplyAndImport(); } } } }
internal static void SaveUnappliedTextureImporterSettings() { foreach (InspectorWindow i in InspectorWindow.GetAllInspectorWindows()) { ActiveEditorTracker activeEditor = i.tracker; foreach (Editor e in activeEditor.activeEditors) { TextureImporterInspector inspector = e as TextureImporterInspector; if (inspector == null) { continue; } if (!inspector.HasModified()) { continue; } TextureImporter importer = inspector.target as TextureImporter; if (EditorUtility.DisplayDialog("Unapplied import settings", "Unapplied import settings for \'" + importer.assetPath + "\'", "Apply", "Revert")) { inspector.ApplyAndImport(); // No way to apply/revert only some assets. Bug: 564192. } } } }