static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (var deletedAsset in deletedAssets) { SpriteEditorWindow.OnTextureReimport(deletedAsset); } foreach (var importedAsset in importedAssets) { SpriteEditorWindow.OnTextureReimport(importedAsset); } }
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { UnityEngine.Object[] wins = Resources.FindObjectsOfTypeAll(typeof(SpriteEditorWindow)); SpriteEditorWindow win = wins.Length > 0 ? (EditorWindow)(wins[0]) as SpriteEditorWindow : null; if (win != null) { foreach (var deletedAsset in deletedAssets) { SpriteEditorWindow.OnTextureReimport(win, deletedAsset); } foreach (var importedAsset in importedAssets) { SpriteEditorWindow.OnTextureReimport(win, importedAsset); } } }