# SetTextureSettings(TextureImporterSettings)

> Sets texture importers settings from TextureImporterSettings class.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public void SetTextureSettings(TextureImporterSettings src)
```

### Parameters

**** (\[TextureImporterSettings]\(/engine/6000.7/script-reference/unityeditor/textureimportersettings)):&#x20;

### Remarks

```csharp
using UnityEngine;
using UnityEditor;

// Automatically convert any texture with "SingleChannel"
// in its path into a single channel texture, and set it to use the red color channel.

class SingleChannelPreprocessor : AssetPostprocessor
{
    void OnPreprocessTexture()
    {
        if (assetPath.Contains("SingleChannel"))
        {
            TextureImporter textureImporter  = (TextureImporter)assetImporter;
            textureImporter.textureType = TextureImporterType.SingleChannel;

            TextureImporterSettings settings = new TextureImporterSettings();
            textureImporter.ReadTextureSettings(settings);
            settings.singleChannelComponent = TextureImporterSingleChannelComponent.Red;
            textureImporter.SetTextureSettings(settings);
        }
    }
}
```

Additional Resources: [TextureImporter.ReadTextureSettings](/engine/6000.7/script-reference/unityeditor/textureimporter/readtexturesettings.md).
