UnityEditor.TextureImporter.GetPlatformTextureSettings C# (CSharp) Method

GetPlatformTextureSettings() public method

Get platform specific texture settings.

public GetPlatformTextureSettings ( string platform ) : TextureImporterPlatformSettings
platform string The platform whose settings are required (see below).
return TextureImporterPlatformSettings
        public TextureImporterPlatformSettings GetPlatformTextureSettings(string platform)
        {
            TextureImporterPlatformSettings dest = new TextureImporterPlatformSettings();
            this.Internal_GetPlatformTextureSettings(platform, dest);
            return dest;
        }

Same methods

TextureImporter::GetPlatformTextureSettings ( string platform, int &maxTextureSize, TextureImporterFormat &textureFormat ) : bool
TextureImporter::GetPlatformTextureSettings ( string platform, int &maxTextureSize, TextureImporterFormat &textureFormat, int &compressionQuality ) : bool
TextureImporter::GetPlatformTextureSettings ( string platform, int &maxTextureSize, TextureImporterFormat &textureFormat, int &compressionQuality, bool &etc1AlphaSplitEnabled ) : bool

Usage Example

        public void AnalyzerTexture()
        {
            this.width = this.texture.width;
            this.height = this.texture.height;
            this.size = CalculateTextureSizeBytes(this.texture);
            this.ti = AssetImporter.GetAtPath(path) as TextureImporter;
            if (ti != null)
            {
                this.isRW = ti.isReadable;

                androidPlatSetting.isSetting = ti.GetPlatformTextureSettings(TexturePlatSetting.PLAT_ANDROID,
                        out androidPlatSetting.maxSize, out androidPlatSetting.textureFormat);

                iosPlatSetting.isSetting = ti.GetPlatformTextureSettings(TexturePlatSetting.PLAT_IPHONE,
                        out iosPlatSetting.maxSize, out iosPlatSetting.textureFormat);

                standalonePlatSetting.isSetting = ti.GetPlatformTextureSettings(TexturePlatSetting.PLAT_STANDALONE,
                        out standalonePlatSetting.maxSize, out standalonePlatSetting.textureFormat);

                this.isMipmap = ti.mipmapEnabled;
                this.isLightmap = ti.lightmap;
                this.anisoLevel = ti.anisoLevel;
            }

            CheckValid();
        }
All Usage Examples Of UnityEditor.TextureImporter::GetPlatformTextureSettings