Exemple #1
0
        //================================================================================
        // 関数
        //================================================================================
        /// <summary>
        /// 指定された TextureImporterPlatformSettings に設定を適用します
        /// </summary>
        public void Apply(UnityEditor.TextureImporterPlatformSettings settings)
        {
            if (m_overridden.IsOverride)
            {
                settings.overridden = m_overridden.Value;
            }

            if (m_maxTextureSize.IsOverride)
            {
                settings.maxTextureSize = m_maxTextureSize.Value;
            }

            if (m_resizeAlgorithm.IsOverride)
            {
                settings.resizeAlgorithm = m_resizeAlgorithm.Value;
            }

            if (m_format.IsOverride)
            {
                settings.format = m_format.Value;
            }

            if (m_textureCompression.IsOverride)
            {
                settings.textureCompression = m_textureCompression.Value;
            }

            if (m_compressionQuality.IsOverride)
            {
                settings.compressionQuality = m_compressionQuality.Value;
            }

            if (m_crunchedCompression.IsOverride)
            {
                settings.crunchedCompression = m_crunchedCompression.Value;
            }

            if (m_allowsAlphaSplitting.IsOverride)
            {
                settings.allowsAlphaSplitting = m_allowsAlphaSplitting.Value;
            }

            if (m_androidEtc2FallbackOverride.IsOverride)
            {
                settings.androidETC2FallbackOverride = m_androidEtc2FallbackOverride.Value;
            }
        }
Exemple #2
0
 public void Apply()
 {
     for (int i = 0; i < this.importers.Length; i++)
     {
         TextureImporter textureImporter = this.importers[i];
         TextureImporterPlatformSettings platformTextureSettings = textureImporter.GetPlatformTextureSettings(this.name);
         if (!this.m_OverriddenIsDifferent)
         {
             platformTextureSettings.overridden = this.m_PlatformSettings.overridden;
         }
         if (!this.m_TextureFormatIsDifferent)
         {
             platformTextureSettings.format = this.m_PlatformSettings.format;
         }
         if (!this.m_MaxTextureSizeIsDifferent)
         {
             platformTextureSettings.maxTextureSize = this.m_PlatformSettings.maxTextureSize;
         }
         if (!this.m_ResizeAlgorithmIsDifferent)
         {
             platformTextureSettings.resizeAlgorithm = this.m_PlatformSettings.resizeAlgorithm;
         }
         if (!this.m_TextureCompressionIsDifferent)
         {
             platformTextureSettings.textureCompression = this.m_PlatformSettings.textureCompression;
         }
         if (!this.m_CompressionQualityIsDifferent)
         {
             platformTextureSettings.compressionQuality = this.m_PlatformSettings.compressionQuality;
         }
         if (!this.m_CrunchedCompressionIsDifferent)
         {
             platformTextureSettings.crunchedCompression = this.m_PlatformSettings.crunchedCompression;
         }
         if (!this.m_AlphaSplitIsDifferent)
         {
             platformTextureSettings.allowsAlphaSplitting = this.m_PlatformSettings.allowsAlphaSplitting;
         }
         if (!this.m_AndroidETC2FallbackOverrideIsDifferent)
         {
             platformTextureSettings.androidETC2FallbackOverride = this.m_PlatformSettings.androidETC2FallbackOverride;
         }
         textureImporter.SetPlatformTextureSettings(platformTextureSettings);
     }
 }
Exemple #3
0
        public TextureImporterFormat GetAutomaticFormat(string platform)
        {
            TextureImporterSettings textureImporterSettings = new TextureImporterSettings();

            this.ReadTextureSettings(textureImporterSettings);
            TextureImporterPlatformSettings        platformTextureSettings = this.GetPlatformTextureSettings(platform);
            List <BuildPlayerWindow.BuildPlatform> validPlatforms          = BuildPlayerWindow.GetValidPlatforms();
            TextureImporterFormat result;

            foreach (BuildPlayerWindow.BuildPlatform current in validPlatforms)
            {
                if (current.name == platform)
                {
                    result = TextureImporter.FormatFromTextureParameters(textureImporterSettings, platformTextureSettings, this.DoesSourceTextureHaveAlpha(), this.IsSourceTextureHDR(), current.DefaultTarget);
                    return(result);
                }
            }
            result = TextureImporterFormat.Automatic;
            return(result);
        }
Exemple #4
0
        public TextureImporterFormat GetAutomaticFormat(string platform)
        {
            TextureImporterSettings settings = new TextureImporterSettings();

            ReadTextureSettings(settings);
            TextureImporterPlatformSettings platformSettings = GetPlatformTextureSettings(platform);

            List <BuildPlatform> validPlatforms = BuildPlatforms.instance.GetValidPlatforms();

            foreach (BuildPlatform bp in validPlatforms)
            {
                if (bp.name == platform)
                {
                    return(FormatFromTextureParameters(settings,
                                                       platformSettings,
                                                       DoesSourceTextureHaveAlpha(),
                                                       IsSourceTextureHDR(),
                                                       bp.defaultTarget));
                }
            }

            return(TextureImporterFormat.Automatic);
        }
 public extern void CopyTo(TextureImporterPlatformSettings target);
Exemple #6
0
 // Set specific target platform settings
 public void SetPlatformTextureSettings(TextureImporterPlatformSettings platformSettings)
 {
     // we need to fix the name in case the user changed it to some mismatching value
     platformSettings.name = GetFixedPlatformName(platformSettings.name);
     SetPlatformTextureSettings_Internal(platformSettings);
 }
Exemple #7
0
 private extern void SetPlatformTextureSettings_Internal(TextureImporterPlatformSettings platformSettings);
 public extern void SetPlatformTextureSettings(TextureImporterPlatformSettings platformSettings);
 public void CopyTo(TextureImporterPlatformSettings target)
 {
     Copy(this, target);
 }
Exemple #10
0
 // Set specific target platform settings
 public extern void SetPlatformTextureSettings(TextureImporterPlatformSettings platformSettings);
        public TextureImportPlatformSettings(string name, BuildTarget target, TextureImporterInspector inspector)
        {
            m_PlatformSettings.name = name;

            m_Target    = target;
            m_Inspector = inspector;
            m_PlatformSettings.overridden = false;
            m_Importers = inspector.targets.Select(x => x as TextureImporter).ToArray();
            for (int i = 0; i < importers.Length; i++)
            {
                TextureImporter imp = importers[i];
                TextureImporterPlatformSettings curPlatformSettings = imp.GetPlatformTextureSettings(name);

                if (i == 0)
                {
                    m_PlatformSettings = curPlatformSettings;
                }
                else
                {
                    if (curPlatformSettings.overridden != m_PlatformSettings.overridden)
                    {
                        m_OverriddenIsDifferent = true;
                    }
                    if (curPlatformSettings.format != m_PlatformSettings.format)
                    {
                        m_TextureFormatIsDifferent = true;
                    }
                    if (curPlatformSettings.maxTextureSize != m_PlatformSettings.maxTextureSize)
                    {
                        m_MaxTextureSizeIsDifferent = true;
                    }
                    if (curPlatformSettings.resizeAlgorithm != m_PlatformSettings.resizeAlgorithm)
                    {
                        m_ResizeAlgorithmIsDifferent = true;
                    }
                    if (curPlatformSettings.textureCompression != m_PlatformSettings.textureCompression)
                    {
                        m_TextureCompressionIsDifferent = true;
                    }
                    if (curPlatformSettings.compressionQuality != m_PlatformSettings.compressionQuality)
                    {
                        m_CompressionQualityIsDifferent = true;
                    }
                    if (curPlatformSettings.crunchedCompression != m_PlatformSettings.crunchedCompression)
                    {
                        m_CrunchedCompressionIsDifferent = true;
                    }
                    if (curPlatformSettings.allowsAlphaSplitting != m_PlatformSettings.allowsAlphaSplitting)
                    {
                        m_AlphaSplitIsDifferent = true;
                    }
                    if (curPlatformSettings.androidETC2FallbackOverride !=
                        m_PlatformSettings.androidETC2FallbackOverride)
                    {
                        m_AndroidETC2FallbackOverrideIsDifferent = true;
                    }
                }
            }

            Sync();
        }
 /// <summary>
 /// <para>Get platform specific texture settings.</para>
 /// </summary>
 /// <param name="platform">The platform whose settings are required (see below).</param>
 /// <returns>
 /// <para>A TextureImporterPlatformSettings structure containing the platform parameters.</para>
 /// </returns>
 public TextureImporterPlatformSettings GetPlatformTextureSettings(string platform)
 {
     TextureImporterPlatformSettings dest = new TextureImporterPlatformSettings();
     this.Internal_GetPlatformTextureSettings(platform, dest);
     return dest;
 }
 internal static extern TextureImporterFormat FormatFromTextureParameters(TextureImporterSettings settings, TextureImporterPlatformSettings platformSettings, bool doesTextureContainAlpha, bool sourceWasHDR, BuildTarget destinationPlatform);
 public void SetPlatformTextureSettings(string platform, int maxTextureSize, TextureImporterFormat textureFormat, int compressionQuality, bool allowsAlphaSplit)
 {
     TextureImporterPlatformSettings dest = new TextureImporterPlatformSettings();
     this.Internal_GetPlatformTextureSettings(platform, dest);
     dest.overridden = true;
     dest.maxTextureSize = maxTextureSize;
     dest.format = textureFormat;
     dest.compressionQuality = compressionQuality;
     dest.allowsAlphaSplitting = allowsAlphaSplit;
     this.SetPlatformTextureSettings(dest);
 }
 public void SetPlatformTextureSettings(string platform, int maxTextureSize, TextureImporterFormat textureFormat, [DefaultValue("false")] bool allowsAlphaSplit)
 {
     TextureImporterPlatformSettings dest = new TextureImporterPlatformSettings();
     this.Internal_GetPlatformTextureSettings(platform, dest);
     dest.overridden = true;
     dest.maxTextureSize = maxTextureSize;
     dest.format = textureFormat;
     dest.allowsAlphaSplitting = allowsAlphaSplit;
     this.SetPlatformTextureSettings(dest);
 }
 public extern void CopyTo(TextureImporterPlatformSettings target);
Exemple #17
0
 public abstract void SetPlatformTextureSettings(int i, TextureImporterPlatformSettings platformSettings);
Exemple #18
0
 public override void SetPlatformTextureSettings(int i, TextureImporterPlatformSettings platformSettings)
 {
     m_Importers[i].SetPlatformTextureSettings(platformSettings);
 }
Exemple #19
0
 internal static extern TextureImporterFormat FormatFromTextureParameters([NotNull] TextureImporterSettings settings, TextureImporterPlatformSettings platformSettings, bool doesTextureContainAlpha, bool sourceWasHDR, BuildTarget destinationPlatform);
Exemple #20
0
 internal extern void Internal_GetPlatformTextureSettings(string platform, TextureImporterPlatformSettings dest);
 private static extern void Copy([NotNull] TextureImporterPlatformSettings self, [Out][NotNull] TextureImporterPlatformSettings target);
 internal extern void Internal_GetPlatformTextureSettings(string platform, TextureImporterPlatformSettings dest);