Кстати, у меня так и не получилось настроить clamp из скрипта .
Синтаксис:
Используется csharp
using UnityEngine;
using UnityEditor;
using System.Collections;
///################################################################################################
/// Настраивалка текстур.
///################################################################################################
/// Выставляем необходимые настройки при импорте.
///################################################################################################
public class TexturePreprocessor : AssetPostprocessor
{
void OnPreprocessTexture()
{
///#####################################
///Раскоментить и импортнуть текстурку - тогда на этом компе перестанет работать.
///Пока не включите обратно).
///#####################################
//EditorPrefs.SetBool("TweakMats",false);
if (EditorPrefs.GetBool("TweakMats") == true)
{
TextureImporter textureImporter = assetImporter as TextureImporter;
textureImporter.mipmapEnabled = false;
textureImporter.textureFormat = TextureImporterFormat.DXT5;
if (assetPath.Contains("_32b"))
{
textureImporter.textureFormat = TextureImporterFormat.ARGB32;
}
if (assetPath.Contains("_16b"))
{
textureImporter.textureFormat = TextureImporterFormat.ARGB16;
}
if (assetPath.Contains("_dxt1"))
{
textureImporter.textureFormat = TextureImporterFormat.DXT1;
}
if (assetPath.Contains("_dxt5"))
{
textureImporter.textureFormat = TextureImporterFormat.DXT5;
}
if (assetPath.Contains("_mipmap"))
{
textureImporter.mipmapEnabled = true;
}
}
}
}
using UnityEditor;
using System.Collections;
///################################################################################################
/// Настраивалка текстур.
///################################################################################################
/// Выставляем необходимые настройки при импорте.
///################################################################################################
public class TexturePreprocessor : AssetPostprocessor
{
void OnPreprocessTexture()
{
///#####################################
///Раскоментить и импортнуть текстурку - тогда на этом компе перестанет работать.
///Пока не включите обратно).
///#####################################
//EditorPrefs.SetBool("TweakMats",false);
if (EditorPrefs.GetBool("TweakMats") == true)
{
TextureImporter textureImporter = assetImporter as TextureImporter;
textureImporter.mipmapEnabled = false;
textureImporter.textureFormat = TextureImporterFormat.DXT5;
if (assetPath.Contains("_32b"))
{
textureImporter.textureFormat = TextureImporterFormat.ARGB32;
}
if (assetPath.Contains("_16b"))
{
textureImporter.textureFormat = TextureImporterFormat.ARGB16;
}
if (assetPath.Contains("_dxt1"))
{
textureImporter.textureFormat = TextureImporterFormat.DXT1;
}
if (assetPath.Contains("_dxt5"))
{
textureImporter.textureFormat = TextureImporterFormat.DXT5;
}
if (assetPath.Contains("_mipmap"))
{
textureImporter.mipmapEnabled = true;
}
}
}
}