592 多语言适配 ImageLanguageAdapter增加防护,纹理不可读或未使用 Crunch 压缩时跳过纹理赋值
1个文件已修改
9 ■■■■ 已修改文件
Main/Component/UI/Core/ImageLanguageAdapter.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Component/UI/Core/ImageLanguageAdapter.cs
@@ -75,7 +75,14 @@
        img.fillAmount = fillAmount;
        img.fillOrigin = fillOrigin;
        img.preserveAspect = preserveAspect;
        img.alphaHitTestMinimumThreshold = alphaHitTestMinimumThreshold;
        try
        {
            img.alphaHitTestMinimumThreshold = alphaHitTestMinimumThreshold;
        }
        catch (InvalidOperationException)
        {
            // 纹理不可读或未使用 Crunch 压缩时跳过,这是 Unity 内部限制
        }
        img.useSpriteMesh = useSpriteMesh;
        img.pixelsPerUnitMultiplier = pixelsPerUnitMultiplier;
    }