How to set the Texture Mesh Type to"Full rect"in the editor script

I know how to change it in the inspector,
but have no idea how to mass chang the settings in my editor script.
The TextureImporter class seems have none relative attribute.

Hi. Much late, but it’s in TextureImporterSettings. This is how I do it to set FullRect with 0 extrude.

class SunImporter : AssetPostprocessor
    void OnPreprocessTexture()
        if (assetPath.Contains("_Sun")
            TextureImporter textureImporter = (TextureImporter)assetImporter;
            textureImporter.alphaSource = TextureImporterAlphaSource.None;
            textureImporter.sRGBTexture = false;
            textureImporter.spritePackingTag = "Suns";
            textureImporter.textureCompression = TextureImporterCompression.CompressedHQ;
            textureImporter.compressionQuality = 100;

            TextureImporterSettings textureSettings = new TextureImporterSettings();
            textureSettings.spriteMeshType = SpriteMeshType.FullRect;
			textureSettings.spriteExtrude = 0;

As far as I know this is only part of the sprite creation process. I don’t know why it’s not in TextureImporter but here’s a workaround:

If your sprite is already created then you’ll have to create a new one and replace your old one using Sprite.Create. The enumeration is SpriteMeshType. One of the overloads will let you set the SpriteMeshType.