Unity 6.3
0 онлайн 93 гостей 3 в системе
Вход

TextureImporter.SetTextureSettings

Declaration

public void SetTextureSettings(TextureImporterSettings src);

Описание

Устанавливает параметры импортера текстур из TextureImporterSettings class.

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); } } }

Дополнительные ресурсы: ,TextureImporter.ReadTextureSettings,.