When the resource is imported, the preprocessing modifies the settings. Official document link
Case, change the Type of Texutre to NormalMap
the code
public class MyTexturePostprocessor : AssetPostprocessor
{
void OnPreprocessTexture()
{
Debug.Log(assetPath);
if (assetPath.Contains("_bumpmap"))
{
TextureImporter textureImporter = (TextureImporter)assetImporter;
textureImporter.convertToNormalmap = true;
textureImporter.textureType = TextureImporterType.NormalMap;
}
}
}
Other methods