记录一下怎么设置的代码片码,unity2017上测的可以
var importer = AssetImporter.GetAtPath(a2) as TextureImporter;
// 安卓设置
TextureImporterPlatformSettings androidSetting = new TextureImporterPlatformSettings();
androidSetting.name = "Android";
androidSetting.maxTextureSize = 512;
androidSetting.format = TextureImporterFormat.ETC_RGB4;
androidSetting.compressionQuality = 100;
androidSetting.androidETC2FallbackOverride = AndroidETC2FallbackOverride.Quality16Bit;
androidSetting.overridden = true;
// ios设置
TextureImporterPlatformSettings iosSetting = new TextureImporterPlatformSettings();
iosSetting.name = "iPhone";
iosSetting.maxTextureSize = 512;
iosSetting.format = TextureImporterFormat.PVRTC_RGB4;
iosSetting.compressionQuality = 100;
iosSetting.overridden = true;
//
importer.SetPlatformTextureSettings(androidSetting);
importer.SetPlatformTextureSettings(iosSetting);
importer.SaveAndReimport();