UnityEditor.TextureImporter.FormatFromTextureParameters C# (CSharp) Method

FormatFromTextureParameters() private method

private FormatFromTextureParameters ( TextureImporterSettings settings, TextureImporterPlatformSettings platformSettings, bool doesTextureContainAlpha, bool sourceWasHDR, BuildTarget destinationPlatform ) : TextureImporterFormat
settings TextureImporterSettings
platformSettings TextureImporterPlatformSettings
doesTextureContainAlpha bool
sourceWasHDR bool
destinationPlatform BuildTarget
return TextureImporterFormat
        internal static extern TextureImporterFormat FormatFromTextureParameters(TextureImporterSettings settings, TextureImporterPlatformSettings platformSettings, bool doesTextureContainAlpha, bool sourceWasHDR, BuildTarget destinationPlatform);
        /// <summary>

Usage Example

 public void Sync()
 {
     if (!this.isDefault && (!this.overridden || this.m_OverriddenIsDifferent))
     {
         TextureImportPlatformSettings textureImportPlatformSettings = this.m_Inspector.m_PlatformSettings[0];
         this.m_PlatformSettings.maxTextureSize       = textureImportPlatformSettings.maxTextureSize;
         this.m_MaxTextureSizeIsDifferent             = textureImportPlatformSettings.m_MaxTextureSizeIsDifferent;
         this.m_PlatformSettings.textureCompression   = textureImportPlatformSettings.textureCompression;
         this.m_TextureCompressionIsDifferent         = textureImportPlatformSettings.m_TextureCompressionIsDifferent;
         this.m_PlatformSettings.format               = textureImportPlatformSettings.format;
         this.m_TextureFormatIsDifferent              = textureImportPlatformSettings.m_TextureFormatIsDifferent;
         this.m_PlatformSettings.compressionQuality   = textureImportPlatformSettings.compressionQuality;
         this.m_CompressionQualityIsDifferent         = textureImportPlatformSettings.m_CompressionQualityIsDifferent;
         this.m_PlatformSettings.crunchedCompression  = textureImportPlatformSettings.crunchedCompression;
         this.m_CrunchedCompressionIsDifferent        = textureImportPlatformSettings.m_CrunchedCompressionIsDifferent;
         this.m_PlatformSettings.allowsAlphaSplitting = textureImportPlatformSettings.allowsAlphaSplitting;
         this.m_AlphaSplitIsDifferent = textureImportPlatformSettings.m_AlphaSplitIsDifferent;
     }
     if ((this.overridden || this.m_OverriddenIsDifferent) && this.m_PlatformSettings.format < (TextureImporterFormat)0)
     {
         this.m_PlatformSettings.format  = TextureImporter.FormatFromTextureParameters(this.GetSettings(this.importers[0]), this.m_PlatformSettings, this.importers[0].DoesSourceTextureHaveAlpha(), this.importers[0].IsSourceTextureHDR(), this.m_Target);
         this.m_TextureFormatIsDifferent = false;
         for (int i = 1; i < this.importers.Length; i++)
         {
             TextureImporter         textureImporter       = this.importers[i];
             TextureImporterSettings settings              = this.GetSettings(textureImporter);
             TextureImporterFormat   textureImporterFormat = TextureImporter.FormatFromTextureParameters(settings, this.m_PlatformSettings, textureImporter.DoesSourceTextureHaveAlpha(), textureImporter.IsSourceTextureHDR(), this.m_Target);
             if (textureImporterFormat != this.m_PlatformSettings.format)
             {
                 this.m_TextureFormatIsDifferent = true;
             }
         }
     }
 }
All Usage Examples Of UnityEditor.TextureImporter::FormatFromTextureParameters