How to set TextureImporter Import Type via script

I Need to set a TextureImporter’s “Import Type” value via script.
I cannot find the Unity documentation for this parameter.
I can only find “TextureType” but that is definitely NOT what I want.

I want to achieve “Texture Type” : “Advanced” and “Import Type” : “Normal Map” as if I had done this in the editor.

Setting TextureImporter.TextureType to “Normal” looses all my other “Advanced” settings

![alt text]screen shot of the unity texture importer inspector[1]

I didn't test it, but probably setting TextureImporter.normalmap = true; changes the import type.

1 Answer

1

Thank you, That’s the answer

TextureImporter.textureType = TextureImporterType.Advanced;
 TextureImporter.normalmap = true;