三国卡牌客户端基础资源仓库
yyl
8 天以前 d5c61ed998a38d62a03f4d58e4d2fe9516d27ea3
Assets/Editor/Tool/TexturePlatformFormatHelper.cs
@@ -18,7 +18,7 @@
    public const string TARGET_FOLDER = "Assets/ResourcesOut";
    // ---- 图集固定尺寸 ----
    public const int ATLAS_MAX_SIZE = 2048;
    public const int ATLAS_MAX_SIZE = 1024;
    // ---- 压缩质量 ----
    public const int COMPRESSION_QUALITY = 50;
@@ -92,7 +92,7 @@
    /// </summary>
    public static bool ApplyAtlasPlatformSettings(SpriteAtlasImporter importer)
    {
        bool changed = false;
        bool changed = ApplyAtlasMaxTextureSize(importer);
        // Android → ETC2_RGBA8(图集始终含 Alpha)
        {
@@ -142,6 +142,23 @@
        return changed;
    }
    public static bool ApplyAtlasMaxTextureSize(SpriteAtlasImporter importer)
    {
        bool changed = false;
        foreach (var platform in new[] { "Standalone", "Android", "iPhone", "WebGL", "DefaultTexturePlatform" })
        {
            var settings = importer.GetPlatformSettings(platform);
            if (settings.maxTextureSize == ATLAS_MAX_SIZE)
                continue;
            settings.maxTextureSize = ATLAS_MAX_SIZE;
            importer.SetPlatformSettings(settings);
            changed = true;
        }
        return changed;
    }
    // ============================================================
    // 工具方法
    // ============================================================