static void Setting(string assetPath, int maxSize, TextureImporterFormat androidFormat, TextureImporterFormat iosFormat)
{
var texImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;
{
texImporter.npotScale = TextureImporterNPOTScale.ToNearest;
texImporter.isReadable = false;
texImporter.mipmapEnabled = false;
texImporter.alphaIsTransparency = true;
texImporter.wrapMode = TextureWrapMode.Clamp;
texImporter.filterMode = FilterMode.Bilinear;
texImporter.anisoLevel = ; //纹理的各向异性滤波水平
texImporter.SetPlatformTextureSettings("Android", maxSize, androidFormat);
texImporter.SetPlatformTextureSettings("iPhone", maxSize, iosFormat);
texImporter.SetPlatformTextureSettings("Standalone", maxSize, TextureImporterFormat.ARGB32);
} AssetDatabase.ImportAsset(assetPath);
AssetDatabase.SaveAssets();
}
05-01 01:59