how to make OnPreProcesstexture ignore manually changed textures

So I have this script here:

using UnityEngine;
using UnityEditor;

public class TextureProcessor : AssetPostprocessor
{   
  void OnPreprocessTexture()
    {
		
        TextureImporter importer = assetImporter as TextureImporter;
        importer.anisoLevel = 0;
        importer.filterMode = FilterMode.Bilinear;
		importer.wrapMode = TextureWrapMode.Clamp;
		importer.mipmapEnabled = false;
		importer.textureFormat = TextureImporterFormat.PVRTC_RGB4;
		importer.npotScale = TextureImporterNPOTScale.None;
		importer.textureType = TextureImporterType.Advanced;
		importer.maxTextureSize = 2048;
	
		
    }	
}

It changes the default settings on every texture that Unity imports, and it works just fine.

But the thing is it disallows me to manually edit a textures settings. If I go into a texture’s settings, and change something, then click apply, it will do it’s thing, but then this script will override any manual edits I made in the settings.

How do I change that? How can I make it so this script is always enabled, and it will also allow me to make manual changes to textures?

bump

you must enhance your importer to work basing on a naming scheme and only apply it to ‘automatic textures’

you can’t change it anymore with what you set here as any texture when its imported (which happens when you click apply on the texture import settings) gets pushed through this right now, not just ‘automatic handled textures’

OnPreprocessTexture saves a lot of time . We all know how much time we spend in compressing a texture or loading it.

public class MyTextureFormat : AssetPostprocessor
{
      void OnPreprocessTexture(){
        TextureImporter texImport = assetImporter as TextureImporter;
        texImport.textureType = TextureImporterType.Image;
        texImport.alphaIsTransparency = true;
        texImport.maxTextureSize = 512;
        texImport.textureFormat = TextureImporterFormat.AutomaticTruecolor;
      }
}